import {FC} from 'react';
import {useMenuList} from './hooks';
import {Transfer} from 'antd';

type Props = {
  selected: string[],
  onChange: (e: string[]) => void,
};

const Info: FC<Props> = function({selected, onChange}) {
  const data = useMenuList();

  return (
    <Transfer
      dataSource={data}
      targetKeys={selected}
      titles={['未选', '已选']}
      rowKey={item => item.id}
      render={item => item.name}
      onChange={onChange}
    />
  );
};

export default Info;
