import {
    Button,
    Card,
    CardContent,
    Dialog,
    DialogActions,
    DialogContent,
    DialogTitle,
    IconButton,
    Tooltip,
    Typography,
} from "@mui/material";
import RemoveRedEyeIcon from "@mui/icons-material/RemoveRedEye";
import { useState } from "react";

const DescriptionDialog = ({ description }) => {
    const [openDescriptionDialog, setOpenDescriptionDialog] = useState(false);
    return (
        <>
            <Tooltip title="دلیل رد درخواست">
                <IconButton color="primary" onClick={() => setOpenDescriptionDialog(true)}>
                    <RemoveRedEyeIcon />
                </IconButton>
            </Tooltip>
            <Dialog
                fullWidth
                open={openDescriptionDialog}
                onClose={() => setOpenDescriptionDialog(false)}
                PaperProps={{
                    sx: {
                        boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
                    },
                }}
                dir="rtl"
                maxWidth={"sm"}
            >
                <DialogTitle sx={{ fontSize: "large" }}>دلیل رد درخواست</DialogTitle>
                <DialogContent>
                    <Card elevation={0}>
                        <CardContent>
                            <Typography variant="body2">{description || "هیچ توضیحی موجود نیست"} </Typography>
                        </CardContent>
                    </Card>
                </DialogContent>
                <DialogActions>
                    <Button
                        onClick={() => setOpenDescriptionDialog(false)}
                        variant="outlined"
                        color="secondary"
                        autoFocus
                    >
                        بستن
                    </Button>
                </DialogActions>
            </Dialog>
        </>
    );
};
export default DescriptionDialog;
