import { computed, NAME, pattern, UI, type VNode, Writable, } from "commonfabric"; import { Controls, SwitchControl } from "../ui/controls/index.ts"; // deno-lint-ignore no-empty-interface interface SwitchStoryInput {} export interface SwitchStoryOutput { [NAME]: string; [UI]: VNode; controls: VNode; } export default pattern(() => { const checked = new Writable(false); const disabled = new Writable(false); const statusText = computed(() => (checked.get() ? "On" : "Off")); return { [NAME]: "cf-switch Story", [UI]: (
{statusText}
), controls: ( <> ), }; });