// Copyright (C) 2021, Mindee. // This program is licensed under the Apache License version 2. // See LICENSE or go to for full license details. import { Box, makeStyles, Theme } from "@material-ui/core"; import { COLORS, FONTS } from "@mindee/web-elements.assets"; import { Card } from "@mindee/web-elements.ui.card"; import { Typography } from "@mindee/web-elements.ui.typography"; import { Spinner } from "@mindee/web-elements.ui.spinner"; import { AnnotationData, AnnotationShape, AnnotationViewer as AnnotationViewerBase, Stage, } from "react-mindee-js"; const COMPONENT_ID = "AnnotationViewer"; const useStyles = makeStyles((theme: Theme) => ({ wrapper: { height: "100%", }, image: { height: "100%", width: "100%", }, })); interface Props { loadingImage: boolean; annotationData: AnnotationData; setAnnotationStage: (stage: Stage) => void; onShapeMouseEnter: (shape: AnnotationShape) => void; onShapeMouseLeave: (shape: AnnotationShape) => void; onShapeClick: (shape: AnnotationShape) => void; } export default function AnnotationViewer({ setAnnotationStage, annotationData, onShapeMouseLeave, onShapeClick, loadingImage, onShapeMouseEnter, }: Props): JSX.Element { const classes = useStyles(); return ( 3 - Visualize word predictions } className={classes.wrapper} > {loadingImage ? ( ) : !annotationData.image ? ( No image uploaded yet ) : ( )} ); }