import { pattern, UI } from "commonfabric";
interface TagEvent {
label: string;
}
// FIXTURE: ternary-pure-jsx-map-branch
// Verifies: a plain reactive array map inside a ternary JSX branch stays
// pattern-lowered without wrapping the whole branch in extra lift-applied noise.
// recentEvents.length === 0 ? ... :
{recentEvents.map(...)}
// → ifElse(lift(...)(length===0), ..., {recentEvents.mapWithPattern(...)}
)
// Context: implicit JSX ternary branch selection with a pure pattern-owned map
// in the false branch.
export default pattern<{ recentEvents: TagEvent[] }>(({ recentEvents }) => ({
[UI]: (
{recentEvents.length === 0
?
No events yet
: (
{recentEvents.map((event: TagEvent, idx: number) => (
{event.label}
))}
)}
),
}));