Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
408632d7e0
commit
872de9e31c
@@ -286,6 +286,28 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) {
|
||||
</table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<NewFeeItemDialog
|
||||
open={showNewFee}
|
||||
onOpenChange={setShowNewFee}
|
||||
defaultDescription={form.description}
|
||||
defaultAmount={parseFloat(form.hourly_rate || "0") || undefined}
|
||||
defaultBillable={form.billable}
|
||||
onCreated={(item) => {
|
||||
// Insert into local list and select it
|
||||
setFees((prev) =>
|
||||
[...prev, { id: item.id, name: item.name, description: item.description, amount: Number(item.amount), billable: item.billable }]
|
||||
.sort((a, b) => a.name.localeCompare(b.name)),
|
||||
);
|
||||
setSelectedFeeId(item.id);
|
||||
setForm((f) => ({
|
||||
...f,
|
||||
hourly_rate: String(item.amount),
|
||||
billable: item.billable,
|
||||
description: item.description || item.name,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user