import {Dialog, DialogTitle, IconButton, Tooltip} from "@mui/material"
import {useTranslations} from "next-intl";
import {useState} from "react";
import RejectContent from "./RejectContent";
import ThumbDownIcon from "@mui/icons-material/ThumbDown";

const Reject = ({rowId, mutate}) => {
    const t = useTranslations();
    const [openRejectDialog, setOpenRejectDialog] = useState(false);
    return (
        <>
            <Tooltip title={t("RejectDialog.reject")}>
                <IconButton color="primary" onClick={() => setOpenRejectDialog(true)}>
                    <ThumbDownIcon/>
                </IconButton>
            </Tooltip>
            <Dialog fullWidth open={openRejectDialog}
                    PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
                <DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
                <RejectContent mutate={mutate} rowId={rowId} setOpenRejectDialog={setOpenRejectDialog}/>
            </Dialog>
        </>
    )
}
export default Reject