import {Dialog,DialogTitle, IconButton, Tooltip} from "@mui/material"
import {useTranslations} from "next-intl";
import {useState} from "react";
import ContactMailIcon from '@mui/icons-material/ContactMail';
import ReferUserContent from "@/components/dashboard/passenger-boss/Form/ReferUser/ReferUserContent";
const ReferUser = ({rowId, mutate}) => {
    const t = useTranslations();
    const [openReferDialog, setOpenReferDialog] = useState(false);
    return (
        <>
            <Tooltip title={t("ReferDialog.refer-user")}>
                <IconButton color="primary" onClick={() => setOpenReferDialog(true)}>
                    <ContactMailIcon/>
                </IconButton>
            </Tooltip>
            <Dialog fullWidth open={openReferDialog}
                    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("ReferDialog.refer-user")}</DialogTitle>
                <ReferUserContent mutate={mutate} rowId={rowId} setOpenReferDialog={setOpenReferDialog} />
            </Dialog>
        </>
    )
}
export default ReferUser