'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useTranslations } from 'next-intl'; /** * Settings sub-sidebar (D-19, D-20). * Phase 05 categories: Dashboard > Widgets, Calendar. * Active item uses sidebar-accent pattern with aria-current="page". */ export function SettingsSidebar() { const t = useTranslations('settings'); const pathname = usePathname(); const items = [ { label: t('categoryWidgets'), href: '/settings/dashboard', }, { label: t('categoryCalendar'), href: '/settings/dashboard/calendar', }, ]; const isActive = (href: string) => { if (href === '/settings/dashboard') { // Active when exactly on /settings/dashboard (not on sub-routes like /calendar) return pathname === '/settings/dashboard'; } return pathname.startsWith(href); }; return ( // a11y/useSemanticElements: role="navigation" nicht auf das