export default function Preview()

in gemini/autocal/frontend/components/upload/Preview.tsx [35:85]


export default function Preview({ open, handleClose, upload }: Props) {
  const { screenshot } = Status();
  if (screenshot) {
    return (
      <Dialog fullWidth={true} maxWidth="md" open={open}>
        <DialogTitle>Image Preview</DialogTitle>
        <IconButton
          aria-label="close"
          onClick={handleClose}
          sx={(theme) => ({
            position: "absolute",
            right: 8,
            top: 8,
            color: theme.palette.grey[500],
          })}
        >
          <CloseIcon />
        </IconButton>
        <DialogContent>
          <Box
            sx={{
              display: "flex",
              flexDirection: "column",
              m: "auto",
              maxWidth: "sm",
              width: "fit-content",
              overflow: "auto",
              height: "80vh",
              objectFit: "contain",
            }}
          >
            <Box
              component="img"
              sx={{
                width: "100%",
                height: "85%",
                objectFit: "contain",
              }}
              src={`data:${screenshot.type};base64,${screenshot?.base64}`}
              alt="Screenshot"
            />
          </Box>
          <FormGroup>
              <Button type="submit" variant="contained" endIcon={<AutoAwesomeIcon />} sx={{ mt: 2 }} onClick={upload}>
                Process Image
              </Button>
            </FormGroup>
        </DialogContent>
      </Dialog>
    );
  }