import PhotoLibraryIcon from "@mui/icons-material/PhotoLibrary";
import { Button, Dialog, DialogActions, DialogContent, IconButton, Tooltip } from "@mui/material";
import { useState } from "react";
import RecognizePictureContent from "./RecognizePictureContent";

const RecognizePictureDialog = ({ image }) => {
    const [openImageDialog, setOpenImageDialog] = useState(false);

    return (
        <>
            <Tooltip title="تصویر بازدید">
                <IconButton color="primary" onClick={() => setOpenImageDialog(true)}>
                    <PhotoLibraryIcon />
                </IconButton>
            </Tooltip>
            <Dialog
                fullWidth
                open={openImageDialog}
                onClose={() => setOpenImageDialog(false)}
                PaperProps={{
                    sx: {
                        boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
                    },
                }}
                maxWidth={"sm"}
                scroll="paper"
            >
                <DialogContent>
                    <RecognizePictureContent image={image} title={"تصویر بازدید"} />
                </DialogContent>
                <DialogActions>
                    <Button onClick={() => setOpenImageDialog(false)} variant="outlined" color="secondary">
                        بستن
                    </Button>
                </DialogActions>
            </Dialog>
        </>
    );
};
export default RecognizePictureDialog;
