import { ifElse, pattern, UI, Writable } from "commonfabric"; interface Item { name: string; } // FIXTURE: authored-ifelse-jsx-branches // Verifies: authored ifElse in JSX lowers both conditions and reactive branches correctly // ifElse(limit > 0, items.map(...), Hidden) → derived condition + pattern-lowered map branch // ifElse(show, count.get(), 0) in JSX → derived reactive branch, not raw count.get() export default pattern<{ items: Item[]; limit: number; count: Writable; show: boolean; }>(({ items, limit, count, show }) => ({ [UI]: (
{ifElse( limit > 0, items.map((item: Item) => {item.name}), Hidden, )}

{ifElse(show, count.get(), 0)}

), }));