mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-10 22:19:04 +01:00
feat(expense-list): Display the attachment count only when the expense includes attachments (#267)
* feat(expense-list): Display the attachment count only when the expense includes attachments * handle attachments - singular & plural * move documents count between amount and date * Remove label * Use document count only instead of whole document list --------- Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client'
|
||||
import { ActiveUserBalance } from '@/app/groups/[groupId]/expenses/active-user-balance'
|
||||
import { CategoryIcon } from '@/app/groups/[groupId]/expenses/category-icon'
|
||||
import { DocumentsCount } from '@/app/groups/[groupId]/expenses/documents-count'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { getGroupExpenses } from '@/lib/api'
|
||||
import { cn, formatCurrency, formatDate } from '@/lib/utils'
|
||||
@@ -75,6 +76,9 @@ export function ExpenseCard({ expense, currency, groupId }: Props) {
|
||||
>
|
||||
{formatCurrency(currency, expense.amount, locale)}
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground">
|
||||
<DocumentsCount count={expense._count.documents} />
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground">
|
||||
{formatDate(expense.expenseDate, locale, { dateStyle: 'medium' })}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user