File size: 689 Bytes
15d2f30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import Button from "./ui/Button";

interface DataViewerProps {
  onGetRandomSample: () => void;
  imageUrl: string | null;
  label: string | null;
}

export default function DataViewer({ onGetRandomSample, imageUrl, label }: DataViewerProps) {
  return (
    <div className="min-h-0 min-w-0 flex flex-col items-center">
      { imageUrl && (
        <div className="flex flex-col items-center gap-2 p-4">
          <img src={imageUrl} alt="Sample" className="max-h-64 object-contain border border-gray-300"/>
          <div className="text-lg font-medium">Label: {label}</div>
        </div>
      ) }
      <Button label="Get Random Sample" onClick={onGetRandomSample} />
    </div>
  )
}