-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use document count only instead of whole document list
- Loading branch information
Showing
3 changed files
with
5 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
import { ExpenseFormValues } from '@/lib/schemas' | ||
import { Paperclip } from 'lucide-react' | ||
import { useTranslations } from 'next-intl' | ||
|
||
type DocumentCount = { | ||
documents: ExpenseFormValues['documents'] | ||
} | ||
export function DocumentsCount({ documents }: DocumentCount) { | ||
const t = useTranslations('ExpenseCard') | ||
const documentsCount = documents.length | ||
if (documentsCount === 0) return <></> | ||
export function DocumentsCount({ count }: { count: number }) { | ||
if (count === 0) return <></> | ||
return ( | ||
<div className="flex items-center"> | ||
<Paperclip className="w-3.5 h-3.5 mr-1 mt-0.5 text-muted-foreground" /> | ||
<span>{documentsCount}</span> | ||
<span>{count}</span> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters