diff --git a/components/calendar/calendar-client.tsx b/components/calendar/calendar-client.tsx index f28065c..52fe0aa 100644 --- a/components/calendar/calendar-client.tsx +++ b/components/calendar/calendar-client.tsx @@ -56,6 +56,14 @@ import { Checkbox } from "@/components/ui/checkbox"; // Register French locale registerLocale('fr', fr); +// Helper function to clean description by removing Microsoft ID prefix +const cleanDescription = (description: string | null | undefined): string | null => { + if (!description) return null; + // Remove [MS_ID:xxx] prefix if present + const cleaned = description.replace(/^\[MS_ID:[^\]]+\]\n?/, ''); + return cleaned.trim() || null; +}; + // Predefined professional color palette const colorPalette = [ "#4f46e5", // Indigo @@ -1239,14 +1247,6 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend } }; - // Helper function to clean description by removing Microsoft ID prefix - const cleanDescription = (description: string | null | undefined): string | null => { - if (!description) return null; - // Remove [MS_ID:xxx] prefix if present - const cleaned = description.replace(/^\[MS_ID:[^\]]+\]\n?/, ''); - return cleaned.trim() || null; - }; - const getCalendarDisplayName = (calendar: CalendarWithMission) => { // If calendar is synced to an external account, use the same display name as in courrier if (calendar.syncConfig?.syncEnabled && calendar.syncConfig?.mailCredential) {