refactor(FE-435,436): Use location name as fallback for expense titles

This commit is contained in:
rstubryan
2025-12-30 21:17:37 +07:00
parent c291ba3246
commit 5e6b03ef08
3 changed files with 11 additions and 3 deletions
@@ -588,7 +588,9 @@ const ExpenseRequestContent = ({
colSpan={5}
className='font-bold text-center text-base-content text-lg'
>
Biaya {kandangExpense.name}
{kandangExpense.name
? `Biaya ${kandangExpense.name}`
: `Biaya ${initialValues?.location.name || 'Umum'}`}
</th>
</tr>
<tr>
@@ -128,7 +128,11 @@ const ExpenseRealizationKandangDetailExpense: React.FC<
>
<div>
<h5 className='mb-2 text-lg font-bold text-center'>
Biaya {kandangName?.name || location?.label || 'Umum'}
{kandangName?.name
? `Biaya ${kandangName.name}`
: location?.label
? `Biaya ${location.label}`
: 'Biaya Umum'}
</h5>
<div className='overflow-x-auto'>
@@ -340,7 +340,9 @@ const ExpensePDF = ({ expense }: ExpensePDFProps) => {
style={ExpensePDFStyle.kandangExpenseContainer}
>
<Text style={ExpensePDFStyle.kandangExpenseTitle}>
{kandangExpense.name}
{kandangExpense.name
? `Biaya ${kandangExpense.name}`
: `Biaya ${expense?.location.name || 'Umum'}`}
</Text>
<View style={ExpensePDFStyle.kandangExpenseTable}>