email box empty styling

This commit is contained in:
debu-2 2026-10-05 21:34:12 +05:30
parent 1ee8a58117
commit 5cb49f4cb1
19 changed files with 547 additions and 67 deletions

View file

@ -0,0 +1,99 @@
export function getMailboxEmptyCopy({
mailbox,
title,
category,
isBrandNew,
hasFilters,
hasSearch,
lens,
}) {
if (hasSearch) {
return {
heading: "No emails found",
description: "Try changing your search or filters.",
primaryCta: null,
secondaryCta: null,
showActiveBadge: false,
};
}
if (hasFilters || lens !== "all") {
return {
heading: "No messages here",
description: "Try another category, label, or filter.",
primaryCta: null,
secondaryCta: { label: "Refresh inbox", action: "refresh" },
showActiveBadge: false,
};
}
if (mailbox === "inbox" && category && category !== "All Mail" && category !== "Primary") {
const categoryHeadings = {
Updates: "No updates here",
Promotions: "No promotions here",
Social: "No social messages here",
Finance: "No finance emails here",
};
const categoryDescriptions = {
Updates: "Emails categorized as updates will appear here.",
Promotions: "Emails categorized as promotions will appear here.",
Social: "Emails categorized as social will appear here.",
Finance: "Emails categorized as finance will appear here.",
};
return {
heading: categoryHeadings[category] || `No ${category.toLowerCase()} here`,
description: categoryDescriptions[category] || `Emails in ${category} will appear here.`,
primaryCta: null,
secondaryCta: { label: "Refresh inbox", action: "refresh" },
showActiveBadge: false,
};
}
if (mailbox === "sent") {
return {
heading: "Nothing sent yet",
description: "Emails you send will appear here.",
primaryCta: { label: "Compose email", action: "compose" },
secondaryCta: null,
showActiveBadge: false,
};
}
if (mailbox === "trash") {
return {
heading: "Trash is empty",
description: "Deleted messages will appear here.",
primaryCta: null,
secondaryCta: { label: "Refresh", action: "refresh" },
showActiveBadge: false,
};
}
if (mailbox === "inbox" && isBrandNew) {
return {
heading: "Welcome to AGMail",
description: "Your inbox is ready. New conversations will appear here.",
primaryCta: { label: "Compose your first email", action: "compose" },
secondaryCta: null,
showActiveBadge: true,
};
}
if (mailbox === "inbox") {
return {
heading: "Your inbox is all clear",
description: "New emails will appear here when they arrive.",
primaryCta: { label: "Compose email", action: "compose" },
secondaryCta: { label: "Refresh inbox", action: "refresh" },
showActiveBadge: false,
};
}
return {
heading: `No messages in ${title.toLowerCase()}`,
description: `Messages in ${title.toLowerCase()} will appear here.`,
primaryCta: null,
secondaryCta: { label: "Refresh", action: "refresh" },
showActiveBadge: false,
};
}