ui enhancement

This commit is contained in:
debu-2 2026-10-03 22:13:49 +05:30
parent 78aac5a925
commit 45e3898acb
4 changed files with 175 additions and 91 deletions

View file

@ -87,3 +87,19 @@ export function attachmentCount(email) {
if (Array.isArray(email.attachments)) return email.attachments.length;
return Number(email.attachment_count || 0);
}
export function labelCounts(emails) {
const counts = {
Important: 0,
Projects: 0,
Clients: 0,
Finance: 0,
Personal: 0,
};
emails.forEach((email) => {
emailLabels(email).forEach((label) => {
counts[label.name] = (counts[label.name] || 0) + 1;
});
});
return counts;
}