export default function ExamplePanel({ setInput, setFiles, }: { setInput: (input: string) => void; setFiles: (files: FileList | undefined) => void; }) { const createFileList = (file: File): FileList => { const dt = new DataTransfer(); dt.items.add(file); return dt.files; }; // New handler for the "Replicate this flowchart" button const handleReplicateFlowchart = async () => { setInput("Replicate this flowchart."); try { // Fetch the example image const response = await fetch("/example.png"); const blob = await response.blob(); const file = new File([blob], "example.png", { type: "image/png" }); // Set the file to the files state setFiles(createFileList(file)); } catch (error) { console.error("Error loading example image:", error); } }; return (
{" "} Start a conversation to generate or modify diagrams.
{" "} You can also upload images to use as references.
Try these examples: