Fix budget SelectValue showing ID instead of name in edit dialog
Pass budget name as explicit children to SelectValue so the selected label renders correctly. Also handle TRANSFER type display in the header. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,8 +80,8 @@ export function EditTransactionDialog({ transaction, onOpenChange, budgets }: Pr
|
||||
{transaction.description}
|
||||
</DialogTitle>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{date} · <span className={transaction.type === 'CREDIT' ? 'text-green-600' : ''}>
|
||||
{transaction.type === 'CREDIT' ? '+' : '-'}{formatCents(transaction.amountCents)}
|
||||
{date} · <span className={transaction.type === 'CREDIT' ? 'text-green-600' : transaction.type === 'TRANSFER' ? 'text-muted-foreground' : ''}>
|
||||
{transaction.type === 'TRANSFER' ? '⇄ ' : transaction.type === 'CREDIT' ? '+' : '-'}{formatCents(transaction.amountCents)}
|
||||
</span>
|
||||
</p>
|
||||
</DialogHeader>
|
||||
@@ -101,7 +101,11 @@ export function EditTransactionDialog({ transaction, onOpenChange, budgets }: Pr
|
||||
<Label htmlFor="budget">Budget</Label>
|
||||
<Select value={budgetId} onValueChange={(v) => setBudgetId(v ?? '')}>
|
||||
<SelectTrigger id="budget">
|
||||
<SelectValue placeholder="No budget" />
|
||||
<SelectValue placeholder="No budget">
|
||||
{budgetId
|
||||
? (budgets.find((b) => b.id === budgetId)?.name ?? 'No budget')
|
||||
: 'No budget'}
|
||||
</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="">No budget</SelectItem>
|
||||
|
||||
Reference in New Issue
Block a user