import { FormatterProps } from "../Format.types"; import { useRenderFormat } from "../../../hooks/useRenderFormat"; export interface FormatOptionalProps extends FormatterProps {} /** Optionally render a potentially null value. * If the value is null / undefined, the `fallback` is rendered, * otherwise the given `value` is rendered */ export function FormatOptional(props: FormatOptionalProps) { return useRenderFormat((v: T) => v, props); }