import React from 'react';
import { Dialog, DialogTitle, DialogContent, useMediaQuery } from '@mui/material';
import { DocumentForm } from './DocumentForm';

interface AddDocumentDialogProps {
  open: boolean;
  onClose: () => void;
}

export const AddDocumentDialog: React.FC<AddDocumentDialogProps> = ({ open, onClose }) => {
  const isSmall = useMediaQuery('(max-width:600px)');

  return (
    <Dialog open={open} onClose={onClose} maxWidth="md" fullWidth fullScreen={isSmall} PaperProps={{ sx: { maxHeight: '90vh' } }}>
      <DialogTitle>Add Document</DialogTitle>
      <DialogContent>
        <div className="mt-2">
          <DocumentForm onSuccess={onClose} onCancel={onClose} />
        </div>
      </DialogContent>
    </Dialog>
  );
};

export default AddDocumentDialog;

