refactor: update defaultLabels structure in mail component for improved clarity and usability

This commit is contained in:
Aj Wazzan
2025-05-11 14:25:19 -07:00
parent 7df47bf9cc
commit 812b78e5e8

View File

@@ -66,22 +66,37 @@ interface Tag {
text: string;
}
const defaultLabels = [
'urgent',
'review',
'followup',
'decision',
'work',
'finance',
'legal',
'hiring',
'sales',
'product',
'support',
'vendors',
'marketing',
'meeting',
'investors',
export const defaultLabels = [
{
name: 'to respond',
usecase: 'emails you need to respond to. NOT sales, marketing, or promotions.',
},
{
name: 'FYI',
usecase:
'emails that are not important, but you should know about. NOT sales, marketing, or promotions.',
},
{
name: 'comment',
usecase:
'Team chats in tools like Google Docs, Slack, etc. NOT marketing, sales, or promotions.',
},
{
name: 'notification',
usecase: 'Automated updates from services you use. NOT sales, marketing, or promotions.',
},
{
name: 'promotion',
usecase: 'Sales, marketing, cold emails, special offers or promotions. NOT to respond to.',
},
{
name: 'meeting',
usecase: 'Calendar events, invites, etc. NOT sales, marketing, or promotions.',
},
{
name: 'billing',
usecase: 'Billing notifications. NOT sales, marketing, or promotions.',
},
];
const AutoLabelingSettings = () => {
@@ -101,7 +116,9 @@ const AutoLabelingSettings = () => {
}, [storedLabels]);
const handleResetToDefault = useCallback(() => {
setLabels(defaultLabels.map((label) => ({ id: label, name: label, text: label })));
setLabels(
defaultLabels.map((label) => ({ id: label.name, name: label.name, text: label.name })),
);
}, [storedLabels]);
return (