import React from "react";
import { Modal, Select } from "antd";

interface AssignModalProps {
  isOpen: boolean;
  options: { value: unknown; label: unknown }[];
  value: number | undefined;
  onSelectAnnotator: (id: number) => void;
  onConfirm: () => void;
  onCancel: () => void;
}

const AssignModal: React.FC<AssignModalProps> = ({
  isOpen,
  options,
  value,
  onSelectAnnotator,
  onConfirm,
  onCancel,
}) => {
  return (
    <Modal
      width={320}
      title="选择标注"
      open={isOpen}
      closable
      cancelText="再想想"
      okText="确定"
      onOk={onConfirm}
      onCancel={onCancel}
    >
      <Select
        style={{ width: "100%", marginBottom: 20 }}
        placeholder="选择标注"
        value={value}
        onChange={(id) => onSelectAnnotator(id)}
        options={options}
      />
    </Modal>
  );
};

export default AssignModal;
