diff --git a/app/components/InputSelect.tsx b/app/components/InputSelect.tsx index ae27a55431..7111993fcb 100644 --- a/app/components/InputSelect.tsx +++ b/app/components/InputSelect.tsx @@ -21,6 +21,7 @@ import { InputSelectContent, InputSelectItem, InputSelectSeparator, + InputSelectHeading, InputSelectTrigger, type TriggerButtonProps, } from "./primitives/InputSelect"; @@ -35,6 +36,13 @@ type Separator = { type: "separator"; }; +type Heading = { + /* Denotes a non-selectable heading rendered above a group of options. */ + type: "heading"; + /* Text shown as the heading label. */ + label: string; +}; + export type Item = { /* Denotes a selectable option in the menu. */ type: "item"; @@ -48,7 +56,7 @@ export type Item = { icon?: React.ReactElement; }; -export type Option = Item | Separator; +export type Option = Item | Separator | Heading; type Props = Omit, "onChange"> & { /* Options to display in the select menu. */ @@ -118,6 +126,14 @@ export const InputSelect = React.forwardRef( return ; } + if (option.type === "heading") { + return ( + + {option.label} + + ); + } + return (