import { useContext, useRef } from "preact/hooks"; import { ParentComponent } from "../react/react_utils"; import { ComponentChildren } from "preact"; interface RightPanelWidgetProps { title: string; children: ComponentChildren; buttons?: ComponentChildren; } export default function RightPanelWidget({ title, buttons, children }: RightPanelWidgetProps) { const containerRef = useRef(null); const parentComponent = useContext(ParentComponent); if (parentComponent) { parentComponent.initialized = Promise.resolve(); } return (
{title}
{buttons}
{children}
); }