import React, { useState } from 'react';
import { NodeEditorProps } from '@/components/FlowEditor/nodeEditors';
import { Typography } from '@arco-design/web-react';
import { IconUnorderedList } from '@arco-design/web-react/icon';
import EventSelect from '@/components/FlowEditor/nodeEditors/components/EventSelect';
import { tempEventList } from '@/pages/flowEditor/test/exampleFlowData';

const EventSendEditor: React.FC<NodeEditorProps> = ({ nodeData, updateNodeData }) => {
  const [eventList, setEventList] = useState<any[]>(tempEventList);
  return (
    <>
      <Typography.Title heading={5}><IconUnorderedList style={{ marginRight: 5 }} />输入参数</Typography.Title>
      <EventSelect
        eventList={eventList}
        type="send"
        onUpdateData={(data) => {
          updateNodeData('component', {
            ...data
          });
        }}></EventSelect>
    </>
  );
};

export default EventSendEditor;