/* eslint-disable react-perf/jsx-no-new-object-as-prop */ /* eslint-disable react-perf/jsx-no-new-function-as-prop */ import { createElements, createLinks, GraphProvider, Highlighter, Paper, type InferElement, } from '@joint/react'; import '../index.css'; import { useState } from 'react'; import { PAPER_CLASSNAME, PRIMARY, SECONDARY } from 'storybook-config/theme'; const initialElements = createElements([ { id: '1', label: 'Node 1', x: 100, y: 50, width: 125, height: 25, }, { id: '2', label: 'Node 2', x: 100, y: 200, width: 120, height: 25, }, ]); const initialEdges = createLinks([ { id: 'e1-2', source: '1', target: '2', attrs: { line: { stroke: PRIMARY, }, }, }, ]); type BaseElementWithData = InferElement; function RenderItemWithChildren({ height, width, label }: BaseElementWithData) { const [isHighlighted, setIsHighlighted] = useState(false); return ( setIsHighlighted(true)} onMouseLeave={() => setIsHighlighted(false)} className="node" > {label} ); } function Main() { return (
); } export default function App() { return (
); }