ultisuite-client/components/compte/compte-settings-section-view.tsx
R3D347HR4Y 3bbf3691b0
Some checks failed
E2E / Playwright e2e (push) Has been cancelled
bordel c'est beau
2026-06-11 10:10:39 +02:00

34 lines
980 B
TypeScript

"use client"
import {
resolveCompteSettingsSection,
type CompteSettingsSectionId,
} from "@/lib/compte-settings/settings-nav"
import { CompteHomeSection } from "@/components/compte/sections/compte-home-section"
import { ComptePersonalInfoSection } from "@/components/compte/sections/compte-personal-info-section"
import { CompteSecuritySection } from "@/components/compte/sections/compte-security-section"
const SECTIONS: Record<CompteSettingsSectionId, React.ComponentType> = {
home: CompteHomeSection,
"personal-info": ComptePersonalInfoSection,
security: CompteSecuritySection,
}
export function CompteSettingsSectionView({
sectionId,
}: {
sectionId: CompteSettingsSectionId
}) {
const Section = SECTIONS[sectionId]
return <Section />
}
export function CompteSettingsSectionFromSegments({
segments,
}: {
segments?: string[]
}) {
const sectionId = resolveCompteSettingsSection(segments)
return <CompteSettingsSectionView sectionId={sectionId} />
}