diff --git a/apps/mail/actions/mail.ts b/apps/mail/actions/mail.ts index fbf92b4105..457d5bc93f 100644 --- a/apps/mail/actions/mail.ts +++ b/apps/mail/actions/mail.ts @@ -160,6 +160,28 @@ export const bulkArchive = async ({ ids }: { ids: string[] }) => { } }; +export const bulkStar = async ({ ids }: { ids: string[] }) => { + try { + const driver = await getActiveDriver(); + await driver.modifyLabels(ids, { addLabels: ['STARRED'], removeLabels: [] }); + return { success: true }; + } catch (error) { + console.error('Error marking message as starred:', error); + throw error; + } +}; + +export const bulkUnstar = async ({ ids }: { ids: string[] }) => { + try { + const driver = await getActiveDriver(); + await driver.modifyLabels(ids, { addLabels: [], removeLabels: ['STARRED'] }); + return { success: true }; + } catch (error) { + console.error('Error marking message as unstarred:', error); + throw error; + } +}; + export const muteThread = async ({ ids }: { ids: string[] }) => { try { const driver = await getActiveDriver(); diff --git a/apps/mail/components/mail/mail.tsx b/apps/mail/components/mail/mail.tsx index ba8d146413..290ce20d19 100644 --- a/apps/mail/components/mail/mail.tsx +++ b/apps/mail/components/mail/mail.tsx @@ -9,6 +9,14 @@ import { DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; +import { + bulkArchive, + bulkDeleteThread, + bulkStar, + getMail, + markAsImportant, + markAsRead, +} from '@/actions/mail'; import { Archive2, Bell, @@ -21,13 +29,6 @@ import { User, X, } from '../icons/icons'; -import { - bulkArchive, - bulkDeleteThread, - getMail, - markAsImportant, - markAsRead, -} from '@/actions/mail'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; import { Drawer, DrawerContent, DrawerHeader, DrawerTitle } from '@/components/ui/drawer'; import { ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable'; @@ -523,7 +524,17 @@ function BulkSelectActions() { -