ultisuite-client/lib/mail-settings/settings-nav.ts
R3D347HR4Y 07d57f13a8
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
Add Contact Avatar Features and Improve UI Components
- Introduced new ContactAvatar and ContactAvatarPicker components for enhanced avatar management in contact views.
- Updated ContactDetailView and ContactFormView to utilize the new avatar components, improving user experience when adding or editing contacts.
- Enhanced ContactHoverCard and ContactRow components to display avatars, providing a more visually appealing interface.
- Added loading and error states in ContactsListView for better user feedback during data fetching.
- Implemented a new ContactsLoadState component to handle loading and error scenarios in the contacts list.
- Updated package.json to include @formkit/auto-animate for improved UI animations.
2026-06-06 20:26:51 +02:00

96 lines
2.2 KiB
TypeScript

import type { LucideIcon } from "lucide-react"
import {
Bell,
Bot,
FolderKanban,
Monitor,
PenLine,
Users,
} from "lucide-react"
export type MailSettingsSectionId =
| "display"
| "accounts"
| "signatures"
| "labels"
| "notifications"
| "automation"
export type MailSettingsNavItem = {
id: MailSettingsSectionId
label: string
description: string
href: string
icon: LucideIcon
}
export const MAIL_SETTINGS_NAV: MailSettingsNavItem[] = [
{
id: "display",
label: "Affichage",
description: "Densité, thème, boîte de réception, volet de lecture",
href: "/mail/settings",
icon: Monitor,
},
{
id: "accounts",
label: "Comptes mail",
description: "IMAP, SMTP et identités d'envoi",
href: "/mail/settings/accounts",
icon: Users,
},
{
id: "signatures",
label: "Signatures",
description: "Bibliothèque et attribution par identité",
href: "/mail/settings/signatures",
icon: PenLine,
},
{
id: "labels",
label: "Libellés et dossiers",
description: "Organisation unifiée cross-comptes",
href: "/mail/settings/labels",
icon: FolderKanban,
},
{
id: "notifications",
label: "Notifications",
description: "Alertes desktop, mobile et e-mail",
href: "/mail/settings/notifications",
icon: Bell,
},
{
id: "automation",
label: "Automatisations",
description: "Règles, webhooks, LLM, recherche web, tokens API",
href: "/mail/settings/automation",
icon: Bot,
},
]
export function isMailSettingsNavActive(
pathname: string | null,
item: MailSettingsNavItem
): boolean {
if (item.href === "/mail/settings") {
return (
pathname === "/mail/settings" || pathname === "/mail/settings/display"
)
}
return (
pathname === item.href || Boolean(pathname?.startsWith(`${item.href}/`))
)
}
export function resolveMailSettingsSection(
segments: string[] | undefined
): MailSettingsSectionId {
const slug = segments?.[0]
const match = MAIL_SETTINGS_NAV.find((item) => {
if (item.id === "display") return !slug || slug === "display"
return item.href.endsWith(`/${slug}`)
})
return match?.id ?? "display"
}