import { Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Button } from '@mui/material'

interface ConfirmDeleteDialogProps {
  open: boolean
  onClose: () => void
  onConfirm: () => void
  isLoading?: boolean
  title?: string
  message?: string
}

const ConfirmDeleteDialog = ({
  open,
  onClose,
  onConfirm,
  isLoading,
  title = 'Delete Product',
  message = 'Are you sure you want to delete this product? This action cannot be undone.'
}: ConfirmDeleteDialogProps) => {
  return (
    <Dialog open={open} onClose={onClose}>
      <DialogTitle>{title}</DialogTitle>
      <DialogContent>
        <DialogContentText>{message}</DialogContentText>
      </DialogContent>
      <DialogActions>
        <Button onClick={onClose} disabled={isLoading} color='inherit'>
          Cancel
        </Button>
        <Button onClick={onConfirm} disabled={isLoading} color='error' variant='contained'>
          {isLoading ? 'Deleting...' : 'Delete'}
        </Button>
      </DialogActions>
    </Dialog>
  )
}

export default ConfirmDeleteDialog
