import preview from "#.storybook/preview"; import { Component, JSXElement } from "solid-js"; import { Conditional } from "../../src/ts/components/common/Conditional"; type ConditionalProps = { if: boolean; then: JSXElement; else?: JSXElement; }; const meta = preview.meta({ title: "Common/Conditional", component: Conditional as Component, parameters: { layout: "centered", }, tags: ["autodocs"], argTypes: { if: { control: "boolean" }, }, }); export const Truthy = meta.story({ args: { if: true, then:
Condition is true
, else:
Condition is false
, }, }); export const Falsy = meta.story({ args: { if: false, then:
Condition is true
, else:
Condition is false
, }, }); export const NoFallback = meta.story({ args: { if: true, then:
Visible content
, }, }); export const FalsyNoFallback = meta.story({ args: { if: false, then:
Hidden content
, }, });