ultisuite-client/lib/agenda/agenda-settings-labels.ts
R3D347HR4Y ad1370ea7e
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
feat: enhance configuration and add new demo layouts
- Introduced turbopack alias for canvas in next.config.mjs.
- Updated package.json scripts for development and branding tasks.
- Added new dependencies for Tiptap extensions.
- Implemented new demo layouts for agenda, contacts, drive, and mail applications.
- Enhanced globals.css for improved theming and splash screen animations.
- Added OAuth callback handling for drive mounts.
- Updated layout components to integrate new demo shells and improve structure.
2026-06-12 19:10:24 +02:00

37 lines
1.2 KiB
TypeScript

import type { AgendaDurationStep, AgendaTimeFormat, AgendaWeekStart } from "@/lib/agenda/agenda-settings-types"
import { AGENDA_QUICK_DURATION_OPTIONS, AGENDA_VIDEO_PROVIDER_LABELS } from "@/lib/agenda/agenda-settings-types"
export function formatDurationStepLabel(step: AgendaDurationStep): string {
return step === 60 ? "1 h" : `${step} min`
}
export function formatQuickDurationLabel(minutes: number): string {
const preset = AGENDA_QUICK_DURATION_OPTIONS.find((o) => o.minutes === minutes)
if (preset) return preset.label
if (minutes % 60 === 0) return minutes === 60 ? "1 h" : `${minutes / 60} h`
return `${minutes} min`
}
export function formatTimeFormatLabel(format: AgendaTimeFormat): string {
return format === "12h" ? "AM / PM" : "24 h"
}
export function formatWeekStartLabel(value: AgendaWeekStart): string {
switch (value) {
case "auto":
return "Automatique (locale)"
case 0:
return "Dimanche"
case 1:
return "Lundi"
case 6:
return "Samedi"
default:
return "Automatique (locale)"
}
}
export function videoProviderLabel(provider: keyof typeof AGENDA_VIDEO_PROVIDER_LABELS): string {
return AGENDA_VIDEO_PROVIDER_LABELS[provider]
}