import { REJECT_PASSENGER_OFFICE } from "@/core/data/apiRoutes";
import {
  Dialog,
  DialogTitle,
  DialogContent,
  DialogContentText,
  DialogActions,
  Button,
} from "@mui/material";
import { useTranslations } from "next-intl";

const RejectForm = ({ open, handleClose, handleDelete, rowId, rejectData }) => {
  const t = useTranslations();
  const handleRejectRequest = () => {
    handleDelete();
    rejectData(REJECT_PASSENGER_OFFICE, rowId);
  };
  return (
    <Dialog open={open} onClose={handleClose}>
      <DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
      <DialogContent>
        <DialogContentText>{t("RejectDialog.context")}</DialogContentText>
      </DialogContent>
      <DialogActions>
        <Button onClick={handleRejectRequest} color="primary">
          {t("RejectDialog.button-reject")}
        </Button>
        <Button onClick={handleClose} color="secondary" autoFocus>
          {t("RejectDialog.button-cancel")}
        </Button>
      </DialogActions>
    </Dialog>
  );
};
export default RejectForm;
