refactoring components to match the optimized projections

This commit is contained in:
Knee Cola
2025-11-23 12:00:12 +01:00
parent 1995ad9de9
commit 3368e56124
3 changed files with 37 additions and 25 deletions

View File

@@ -16,7 +16,15 @@ export interface LocationCardProps {
}
export const LocationCard: FC<LocationCardProps> = ({ location, currency }) => {
const { _id, name, yearMonth, bills, seenByTenant, utilBillsProofOfPaymentAttachment } = location;
const {
_id,
name,
yearMonth,
bills,
seenByTenant,
// NOTE: only the fileName is projected from the DB to reduce data transfer
utilBillsProofOfPaymentAttachment
} = location;
const t = useTranslations("home-page.location-card");
const currentLocale = useLocale();