/* eslint-disable react-perf/jsx-no-new-object-as-prop */ import '../index.css'; import { useCallback } from 'react'; import { createElements, createLinks, GraphProvider, MeasuredNode, Paper, type InferElement, type RenderElement, } from '@joint/react'; import { PRIMARY, SECONDARY, LIGHT, PAPER_CLASSNAME } from 'storybook-config/theme'; const initialElements = createElements([ { id: '1', label: 'Node 1', color: PRIMARY, x: 100, y: 10, width: 100, height: 50 }, { id: '2', label: 'Node 2', color: SECONDARY, x: 100, y: 200, width: 100, height: 50 }, ]); const initialEdges = createLinks([ { id: 'e1-2', source: '1', target: '2', attrs: { line: { stroke: LIGHT, }, }, }, ]); type BaseElementWithData = InferElement; function MiniMap() { const renderElement: RenderElement = useCallback( ({ width, height, color }) => ( ), [] ); return (
); } function RenderElement({ width, height, label, color }: Readonly) { return (
Example
{label}
); } function Main() { return (
); } export default function App() { return (
); }