import React from "react"; import { Checkbox } from "./checkbox"; import { ColorWidget } from "./color-widget"; import { NumericSlider } from "./numeric-slider"; import { SvgSymbolContext, swapColors } from "./svg-symbol"; export type SymbolContextWidgetProps = { ctx: T; onChange: (value: T) => void; children?: any; extraButtons?: JSX.Element; }; export function SymbolContextWidget({ ctx, children, onChange, extraButtons, }: SymbolContextWidgetProps): JSX.Element { const updateCtx = (updates: Partial) => { onChange({ ...ctx, ...updates }); }; return (
{children} updateCtx({ stroke })} />{" "} updateCtx({ fill })} />{" "} {" "} {extraButtons} updateCtx({ showSpecs })} /> {ctx.uniformStrokeWidth !== undefined && (
updateCtx({ uniformStrokeWidth })} />
)}
); }