"use client"; import React from "react"; export interface ShowProps { when: T | null | undefined; fallback?: React.ReactNode; children: React.ReactNode | ((props: T) => React.ReactNode); } export function Show(props: ShowProps): React.ReactNode { const { when, fallback, children } = props; let result: React.ReactNode; if (!when) { result = fallback; } else { result = typeof children === "function" ? children(when) : children; } return result; }