import React from 'react';
import { Modal, Button, Tag } from 'antd';
import styles from '../../supplierTaskManageDetail.less';
import type {TaskDetailData} from '@/servers/types/supplierEvaluateTask'

interface EvaluatorModalProps {
  visible: boolean;
  supplier: TaskDetailData;
  onCancel: () => void;
}

const EvaluatorModal: React.FC<EvaluatorModalProps> = ({ visible, supplier, onCancel }) => {
  return (
    <Modal
      title={`${supplier?.supplierName || ''}的评价人员`}
      visible={visible}
      onCancel={onCancel}
      footer={[
        <Button key="close" onClick={onCancel}>
          关闭
        </Button>
      ]}
      width={600}
    >
      {supplier?.userList?.length > 0 ? (
        <div className={styles.evaluatorModalContent}>
          <div className={styles.evaluatorList}>
            {supplier.userList.map((user) => (
              <Tag key={user.userId} className={styles.evaluatorTag}>
                {user.userDept} - {user.userName}
              </Tag>
            ))}
          </div>
        </div>
      ) : (
        <div className={styles.emptyData}>暂无评价人员数据</div>
      )}
    </Modal>
  );
};

export default EvaluatorModal;
