import React from 'react';
import { Modal } from 'antd';
import EvaluateTaskPersonnelSelector from '@/components/EvaluateTaskPersonnelSelector/EvaluateTaskPersonnelSelector';
import type { PersonnelItem } from '@/servers/types/evaluator';

interface BatchEvaluatorModalProps {
  visible: boolean;
  onCancel: () => void;
  onSelect: (selectedEvaluators: PersonnelItem[]) => void;
  selectedPersonnel?: PersonnelItem[];
  filter?: boolean;
  filterUserIds?: string[];
}

const BatchEvaluatorModal: React.FC<BatchEvaluatorModalProps> = ({
  visible,
  onCancel,
  onSelect,
  selectedPersonnel = [],
  filter,
  filterUserIds,
}) => {
  return (
    <Modal
      title="批量选择评价人员"
      visible={visible}
      onCancel={onCancel}
      footer={null}
      width={700}
      destroyOnClose={false}
    >
      <EvaluateTaskPersonnelSelector
        onSelect={onSelect}
        selectedPersonnel={selectedPersonnel}
        filter={filter}
        filterUserIds={filterUserIds}
        onClose={onCancel}
      />
    </Modal>
  );
};

export default BatchEvaluatorModal;
