Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions crates/agent-gui/src/components/ui/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,9 @@ type SelectValueProps = Omit<

export const SelectValue = React.forwardRef<HTMLSpanElement, SelectValueProps>(
({ placeholder, children, ...props }, ref) => {
const rendered =
children !== undefined
? children
: placeholder !== undefined
? (value: unknown) => (value == null ? placeholder : undefined)
: undefined;
return (
<SelectPrimitive.Value ref={ref} {...props}>
{rendered as React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>["children"]}
<SelectPrimitive.Value ref={ref} placeholder={placeholder} {...props}>
{children as React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>["children"]}
</SelectPrimitive.Value>
);
},
Expand Down
Loading