diff --git a/pages/FamilyList.tsx b/pages/FamilyList.tsx
index bf9e056..04e481a 100644
--- a/pages/FamilyList.tsx
+++ b/pages/FamilyList.tsx
@@ -1,9 +1,9 @@
-import React, { useEffect, useState, useMemo } from 'react';
+import React, { useEffect, useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { CondoService } from '../services/mockDb';
import { Family, Condo, Notice, AppSettings, Ticket, TicketStatus } from '../types';
-import { Search, ChevronRight, UserCircle, Building, Bell, AlertTriangle, Hammer, Calendar, Info, Link as LinkIcon, Check, Wallet, Briefcase, MessageSquareWarning, ArrowRight, AlertCircle, CheckCircle2, ChevronDown, ChevronUp } from 'lucide-react';
+import { Search, ChevronRight, UserCircle, Building, Bell, AlertTriangle, Hammer, Calendar, Info, Link as LinkIcon, Check, Wallet, Briefcase, MessageSquareWarning, ArrowRight, CheckCircle2, ChevronDown, ChevronUp, Eye } from 'lucide-react';
export const FamilyList: React.FC = () => {
const navigate = useNavigate();
@@ -60,11 +60,10 @@ export const FamilyList: React.FC = () => {
setMyExtraExpenses(extra);
}
- // 4. Calculate Regular Payment Status (Logic Update)
+ // 4. Calculate Regular Payment Status
const payments = await CondoService.getPaymentsByFamily(currentUser.familyId);
const currentYear = appSettings.currentYear;
const now = new Date();
- const currentRealYear = now.getFullYear();
const currentRealMonth = now.getMonth() + 1; // 1-12
const currentDay = now.getDate();
const dueDay = condo.dueDay || 10;
@@ -107,6 +106,7 @@ export const FamilyList: React.FC = () => {
if (isPrivileged) return true;
+ // Check visibility for regular users
const isPublic = !n.targetFamilyIds || n.targetFamilyIds.length === 0;
const isTargeted = currentUser.familyId && n.targetFamilyIds?.includes(currentUser.familyId);
@@ -117,7 +117,7 @@ export const FamilyList: React.FC = () => {
relevantNotices.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
setNotices(relevantNotices);
- // Check read status
+ // Check read status for current user
const readStatuses = await Promise.all(relevantNotices.map(n => CondoService.getNoticeReadStatus(n.id)));
const readIds: string[] = [];
readStatuses.forEach((reads, idx) => {
@@ -156,10 +156,10 @@ export const FamilyList: React.FC = () => {
const NoticeIcon = ({type}: {type: string}) => {
switch(type) {
- case 'warning': return