ui enhancement
This commit is contained in:
parent
78aac5a925
commit
45e3898acb
4 changed files with 175 additions and 91 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue