From 16757ea90eb2d8355a33850425880cddf5c4671c Mon Sep 17 00:00:00 2001 From: alma Date: Wed, 14 Jan 2026 16:53:52 +0100 Subject: [PATCH] Agenda refactor --- components/calendar/calendar-client.tsx | 28 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/components/calendar/calendar-client.tsx b/components/calendar/calendar-client.tsx index dc85b81..41dcffb 100644 --- a/components/calendar/calendar-client.tsx +++ b/components/calendar/calendar-client.tsx @@ -1149,11 +1149,21 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend }; const getCalendarDisplayName = (calendar: CalendarWithMission) => { - // If calendar is synced to an external account, always show the account name - // (same logic as in courrier page: display_name || email) + // If calendar is synced to an external account, show provider name + account name if (calendar.syncConfig?.syncEnabled && calendar.syncConfig?.mailCredential) { - return calendar.syncConfig.mailCredential.display_name || - calendar.syncConfig.mailCredential.email; + const provider = calendar.syncConfig.provider; + const accountName = calendar.syncConfig.mailCredential.display_name || + calendar.syncConfig.mailCredential.email; + + // Add provider prefix to distinguish Infomaniak from Microsoft + if (provider === 'infomaniak') { + return `Infomaniak (${accountName})`; + } else if (provider === 'microsoft') { + return `Microsoft (${accountName})`; + } else { + // Fallback for unknown providers + return accountName; + } } // For non-synced calendars, use the calendar name @@ -1178,13 +1188,15 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend }} >
- - {getCalendarDisplayName(calendar as CalendarWithMission)} + + + {getCalendarDisplayName(calendar as CalendarWithMission)} + {calendar.syncConfig?.syncEnabled && ( - + Sync )}