import {
  Button,
  Dialog,
  DialogActions,
  DialogContent,
  DialogTitle,
  MenuItem,
  Select,
  Typography,
} from '@mui/material';
import { DocumentDialogProps } from '../AddDocumentDialog';
import { ReactElement } from 'react';

const AttorneyDocumentDialog = ({ showDialog, closeDialog }: DocumentDialogProps): ReactElement => {
  const [documentType, setDocumentType] = useState<string>('');

  const getDialogContent = (document_type: string) => {
    if (document_type === 'offer') {
    } else {
      return <Typography>Please select a document type</Typography>;
    }
  };
  return (
    <Dialog open={showDialog} onClose={closeDialog}>
      <DialogTitle>Create a new document</DialogTitle>
      <DialogContent>
        <Select
          placeholder="Select Document Type"
          onChange={(e) => setDocumentType(e.target.value)}
        >
          <MenuItem value="Select Document Type">Select Document Type</MenuItem>
          <MenuItem value="attorney_engagment_letter">Attorney Engagment Letter</MenuItem>
          <MenuItem value="sellers_disclosure">Seller Disclosure</MenuItem>
          <MenuItem value="closing_document">Closing Document</MenuItem>
          <MenuItem value="title_report">Title Report</MenuItem>
          <MenuItem value="closing_disclosure">Closing Disclosure</MenuItem>
        </Select>
        {getDialogContent(documentType)}
      </DialogContent>
      <DialogActions>
        <Button onClick={closeDialog}>Cancel</Button>
        <Button variant="contained" color="primary" sx={{ ml: 'auto' }}>
          Create
        </Button>
      </DialogActions>
    </Dialog>
  );
};

export default AttorneyDocumentDialog;
