"use client"; import { DrawIoEmbed, DrawIoEmbedRef } from "react-drawio"; import { useRef, useState } from "react"; import { Button } from "@/components/ui/button"; import { extractDiagramXML } from "./extract_xml"; import ChatPanel from "@/components/chatPanel"; export default function Home() { const drawioRef = useRef(null); const [chartXML, setChartXML] = useState(""); const [diagram, setDiagram] = useState(""); // const handleExport = () => {}; const handleExport = () => { // use this function to export the diagramxml from the drawio editor if (drawioRef.current) { drawioRef.current.exportDiagram({ format: "xmlsvg", }); } }; const loadDiagram = (chart: string) => { // use this function to display the diagramxml in the drawio editor if (drawioRef.current) { drawioRef.current.load({ xml: chart, }); } }; return (
setChartXML(extractDiagramXML(data.data))} urlParameters={{ // ui: "kennedy", spin: true, libraries: false, saveAndExit: false, noExitBtn: true, }} />
); }