diff --git a/apps/web/src/optional-props.ts b/apps/web/src/optional-props.ts deleted file mode 100644 index 75b573903..000000000 --- a/apps/web/src/optional-props.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This workspace compiles with exactOptionalPropertyTypes, and the component -// library's optional props are declared without `| undefined` — so a prop -// that may be absent has to be omitted, not passed as undefined. These -// helpers build the omitting form once instead of forking every JSX call -// site into two branches. - -import type { ReactNode } from "react"; - -export function countProp(count: number | undefined): { count?: number } { - return count === undefined ? {} : { count }; -} - -export function subtitleProp(subtitle: string | undefined): { - subtitle?: string; -} { - return subtitle === undefined ? {} : { subtitle }; -} - -export function metaProp(meta: ReactNode | undefined): { meta?: ReactNode } { - return meta === undefined ? {} : { meta }; -} - -export function badgeProp(badge: ReactNode | undefined): { badge?: ReactNode } { - return badge === undefined ? {} : { badge }; -}