fix: show account name in upload select after selection

Base UI Select.Value renders the raw value prop (cuid) rather than
the item label. Pass the looked-up account name as children to
override it. Falls back to placeholder when no account matches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jerick
2026-04-20 22:30:58 -04:00
parent 42f1d34ddd
commit efe42ac366

View File

@@ -97,7 +97,9 @@ export function UploadForm({ accounts }: Props) {
) : ( ) : (
<Select value={accountId} onValueChange={(v) => setAccountId(v ?? '')}> <Select value={accountId} onValueChange={(v) => setAccountId(v ?? '')}>
<SelectTrigger id="account" className="w-72"> <SelectTrigger id="account" className="w-72">
<SelectValue placeholder="Select account" /> <SelectValue placeholder="Select account">
{accounts.find((a) => a.id === accountId)?.name}
</SelectValue>
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
{accounts.map((a) => ( {accounts.map((a) => (