"use client"; import { useTranslations } from 'next-intl'; import { useCalendarStore, CalendarViewMode } from '@/stores/calendar-store'; import { useSettingsStore } from '@/stores/settings-store'; import { usePolicyStore } from '@/stores/policy-store'; import { SettingsSection, SettingItem, Select, ToggleSwitch } from './settings-section'; export function CalendarSettings() { const t = useTranslations('calendar.settings'); const tViews = useTranslations('calendar.views'); const { viewMode, setViewMode } = useCalendarStore(); const { showTimeInMonthView, showWeekNumbers, enableCalendarTasks, showTasksOnCalendar, showBirthdayCalendar, calendarHoverPreview, updateSetting, } = useSettingsStore(); const { isFeatureEnabled } = usePolicyStore(); return ( updateSetting('calendarHoverPreview', value as 'off' | 'instant' | 'delay-500ms' | 'delay-1s' | 'delay-2s')} options={[ { value: 'instant', label: t('hover_preview_instant') }, { value: 'delay-500ms', label: t('hover_preview_delay_500ms') }, { value: 'delay-1s', label: t('hover_preview_delay_1s') }, { value: 'delay-2s', label: t('hover_preview_delay_2s') }, { value: 'off', label: t('hover_preview_off') }, ]} /> updateSetting('showBirthdayCalendar', checked)} /> {isFeatureEnabled('calendarTasksEnabled') && ( <> updateSetting('enableCalendarTasks', checked)} /> {enableCalendarTasks && ( updateSetting('showTasksOnCalendar', checked)} /> )} )} ); }