import React from 'react';
// import styles from '@/pages/flowEditor/node/style/base.module.less';
import styles from '@/components/FlowEditor/node/style/baseOther.module.less';
import NodeContent from '@/pages/flowEditor/components/nodeContent';
import { useStore } from '@xyflow/react';
import { defaultNodeTypes } from '@/components/FlowEditor/node/types/defaultType';
import NodeContentOther from '@/pages/flowEditor/components/nodeContentOther';


const StartNode = ({ data, id }: { data: defaultNodeTypes; id: string }) => {
  const title = data.title || '开始';

  // 获取节点选中状态 - 适配React Flow v12 API
  const isSelected = useStore((state) =>
    state.nodeLookup.get(id)?.selected || false
  );

  return (
    <div className={`${styles['node-container']} ${isSelected ? styles.selected : ''}`}>
      <div className={styles['node-header']} style={{ backgroundColor: '#29b971' }}>
        {title}
      </div>

      {/*<NodeContent data={{ ...data, type: 'start' }} />*/}
      <NodeContentOther data={{ ...data, type: 'start' }} />
    </div>
  );
};

export default StartNode;