* feat(ux): company context in settings, Kundfakturor rename, compact verifikat view Support feedback (2026-07-19): active company invisible in settings, menu said Fakturor next to Leverantorsfakturor, no compact verifikat view. - ActiveCompanyBadge chip in the settings modal header and the full-page settings header; the modal covers the sidebar CompanySwitcher - nav + page title Fakturor -> Kundfakturor (sv), Invoices -> Customer invoices (en); command palette gets a Kundfakturor page entry - verifikat list density toggle (comfortable/compact), persisted per company like the existing sort/page-size choices Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: decision log for scoped Kundfakturor rename Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(review): badge hover reveals full company name; pure density state updater Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
'use client'
|
|
|
|
import { useEffect } from 'react'
|
|
import { useSearchParams, useRouter } from 'next/navigation'
|
|
import { useTranslations } from 'next-intl'
|
|
import { PageHeader } from '@/components/ui/page-header'
|
|
import { SettingsShell } from '@/components/settings/SettingsShell'
|
|
import { ActiveCompanyBadge } from '@/components/settings/ActiveCompanyBadge'
|
|
|
|
const TAB_TO_ROUTE: Record<string, string> = {
|
|
company: '/settings/company',
|
|
invoicing: '/settings/invoicing',
|
|
payments: '/settings/payments',
|
|
bookkeeping: '/settings/bookkeeping',
|
|
tax: '/settings/tax',
|
|
team: '/settings/team',
|
|
banking: '/settings/banking',
|
|
templates: '/settings/templates',
|
|
'agent-memory': '/settings/assistant',
|
|
assistant: '/settings/assistant',
|
|
account: '/settings/account',
|
|
api: '/settings/api',
|
|
}
|
|
|
|
export default function SettingsLayout({ children }: { children: React.ReactNode }) {
|
|
const searchParams = useSearchParams()
|
|
const router = useRouter()
|
|
const t = useTranslations('settings_nav')
|
|
|
|
// Handle legacy ?tab= URLs
|
|
useEffect(() => {
|
|
const tab = searchParams.get('tab')
|
|
if (tab && TAB_TO_ROUTE[tab]) {
|
|
router.replace(TAB_TO_ROUTE[tab])
|
|
}
|
|
}, [searchParams, router])
|
|
|
|
return (
|
|
<div className="space-y-8">
|
|
<PageHeader title={t('aria_label')} action={<ActiveCompanyBadge />} />
|
|
<SettingsShell variant="page">{children}</SettingsShell>
|
|
</div>
|
|
)
|
|
}
|