import { Close } from "@mui/icons-material";
import { Dialog, DialogTitle, IconButton } from "@mui/material";
import ViolationsList from "./ViolationsList";

const ViolationsDialog = ({ open, setOpen, mutate }) => {
    return (
        <Dialog open={open} fullWidth maxWidth="xs">
            <IconButton
                aria-label="close"
                onClick={() => setOpen(false)}
                sx={(theme) => ({
                    position: "absolute",
                    right: 8,
                    top: 8,
                    zIndex: 50,
                    color: theme.palette.grey[500],
                })}
            >
                <Close />
            </IconButton>
            <DialogTitle>تخلفات</DialogTitle>
            {open && <ViolationsList setOpen={setOpen} mutate={mutate} />}
        </Dialog>
    );
};
export default ViolationsDialog;
