import { useAtom } from 'jotai'; import { useDropzone } from 'react-dropzone'; import { targetImageAtom } from '../state'; import Image from 'next/image'; const examples = [ 'https://landing-lens-support.s3.us-east-2.amazonaws.com/vision-agent-examples/cereal-example.jpg', 'https://landing-lens-support.s3.us-east-2.amazonaws.com/vision-agent-examples/people-example.jpeg', 'https://landing-lens-support.s3.us-east-2.amazonaws.com/vision-agent-examples/house-exmaple.jpg', 'https://landing-lens-support.s3.us-east-2.amazonaws.com/vision-agent-examples/safari-example.png', ]; export function EmptyScreen() { const [, setTarget] = useAtom(targetImageAtom); const { getRootProps, getInputProps } = useDropzone({ accept: { 'image/*': ['.jpeg', '.png'], }, multiple: false, onDrop: async acceptedFiles => { try { const file = acceptedFiles[0]; const reader = new FileReader(); reader.onloadend = () => { setTarget(reader.result as string); }; reader.readAsDataURL(file); } catch (err) { console.error(err); } }, }); return (

Welcome to Vision Agent

Lets start by choosing an image

Drag or drop image here, or click to select images

You can also choose from below examples we provided

{examples.map((example, index) => ( example images setTarget(example)} /> ))}
); }