Files
accounted/components/settings/sections/index.ts
T
Mattsson e11f70b347 Bug/gh issues fiz (#1103)
* refactor: optimize page loading and data fetching

* fix: resolve recurring production runtime errors

* feat: add MCP company and customer updates

* fix: handle year-end tax adjustments

* feat: harden annual report compliance

* fix: expand invoice logo and font support

* fix: sanitize API route error responses

* fix: sanitize user-facing error messages

* feat: persist onboarding and tax assessment notices

* fix: reduce cloud backup audit churn

* feat: refine invoice editor layout

* fix: show saved tax adjustments in INK2

* fix: complete annual report API mappings

* docs: record operational safeguards and decisions

* fix: harden annual report review findings

* fix: adjust column span for description based on VAT registration

* New css class name
2026-07-21 23:00:15 +02:00

77 lines
3.2 KiB
TypeScript

import type { ComponentType } from 'react'
import dynamic from 'next/dynamic'
import { SettingsLoadingSkeleton } from '../SettingsLoadingSkeleton'
const AccountSettingsContent = dynamic(() =>
import('./AccountSettingsContent').then((module) => ({ default: module.AccountSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const CompanySettingsContent = dynamic(() =>
import('./CompanySettingsContent').then((module) => ({ default: module.CompanySettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const BookkeepingSettingsContent = dynamic(() =>
import('./BookkeepingSettingsContent').then((module) => ({ default: module.BookkeepingSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const TaxSettingsContent = dynamic(() =>
import('./TaxSettingsContent').then((module) => ({ default: module.TaxSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const SalarySettingsContent = dynamic(() =>
import('./SalarySettingsContent').then((module) => ({ default: module.SalarySettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const InvoicingSettingsContent = dynamic(() =>
import('./InvoicingSettingsContent').then((module) => ({ default: module.InvoicingSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const TemplatesSettingsContent = dynamic(() =>
import('./TemplatesSettingsContent').then((module) => ({ default: module.TemplatesSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const PaymentsSettingsContent = dynamic(() =>
import('./PaymentsSettingsContent').then((module) => ({ default: module.PaymentsSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const BankingSettingsContent = dynamic(() =>
import('./BankingSettingsContent').then((module) => ({ default: module.BankingSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const AssistantSettingsContent = dynamic(() =>
import('./AssistantSettingsContent').then((module) => ({ default: module.AssistantSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const ApiSettingsContent = dynamic(() =>
import('./ApiSettingsContent').then((module) => ({ default: module.ApiSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
const BillingSettingsContent = dynamic(() =>
import('./BillingSettingsContent').then((module) => ({ default: module.BillingSettingsContent })),
{ loading: SettingsLoadingSkeleton },
)
/**
* Single source of truth mapping a settings section id to the component that
* renders its content. Both the per-section route (`settings/<section>/page.tsx`,
* a thin wrapper) and the routed settings modal (`SettingsModal` → `SettingsShell`)
* resolve content through this map, so there is exactly one place a section's
* composition lives.
*/
export const SETTINGS_SECTIONS: Record<string, ComponentType> = {
account: AccountSettingsContent,
company: CompanySettingsContent,
bookkeeping: BookkeepingSettingsContent,
tax: TaxSettingsContent,
salary: SalarySettingsContent,
invoicing: InvoicingSettingsContent,
templates: TemplatesSettingsContent,
payments: PaymentsSettingsContent,
banking: BankingSettingsContent,
assistant: AssistantSettingsContent,
api: ApiSettingsContent,
billing: BillingSettingsContent,
}
export type SettingsSectionId = keyof typeof SETTINGS_SECTIONS