| 1 | "use client"; |
| 2 | |
| 3 | import { SlateElement, type SlateElementProps } from "platejs/static"; |
| 4 | |
| 5 | import { type TChartNode } from "../../plugins/chart-plugin"; |
| 6 | import { ChartRenderer } from "../charts/ChartRenderer"; |
| 7 | |
| 8 | export default function LineGraphStatic(props: SlateElementProps<TChartNode>) { |
| 9 | const element = props.element; |
| 10 | |
| 11 | return ( |
| 12 | <SlateElement {...props}> |
| 13 | <div |
| 14 | className="relative mb-4 w-full" |
| 15 | data-slate-chart={String(element.type)} |
| 16 | > |
| 17 | <ChartRenderer |
| 18 | chartType={String(element.type)} |
| 19 | chartData={element.data} |
| 20 | chartOptions={element as unknown as Record<string, unknown>} |
| 21 | className="min-h-64" |
| 22 | /> |
| 23 | </div> |
| 24 | </SlateElement> |
| 25 | ); |
| 26 | } |
| 27 |