Files
accounted/lib/extensions/settings-panel-registry.tsx
T
Jakob WennbergandClaude Opus 4.6 6956a757f3 feat: consolidate booking templates from 100 to 48 and improve codebase
Reduce booking template library to eliminate duplicate suggestions when
users describe transactions. Templates with identical accounting treatment
(same account + VAT) are merged, keywords consolidated, and the entire
subscriptions group is eliminated. Also includes prior work on reports,
extensions, and transaction improvements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 10:21:10 +01:00

28 lines
937 B
TypeScript

import dynamic from 'next/dynamic'
import type { ComponentType } from 'react'
/**
* Settings panel registry
*
* Maps extension IDs to dynamically imported settings panel components.
* This allows the core settings page to render extension-provided settings
* panels without directly importing from extension directories.
*/
const SETTINGS_PANELS: Record<string, ComponentType> = {
'push-notifications': dynamic(
() => import('@/extensions/general/push-notifications/NotificationSettings').then(m => ({ default: m.NotificationSettings }))
),
'enable-banking': dynamic(
() => import('@/extensions/general/enable-banking/components/BankingSettingsPanel')
),
}
/**
* Get the settings panel component for an extension.
* Returns null if the extension has no registered settings panel.
*/
export function getSettingsPanel(extensionId: string): ComponentType | null {
return SETTINGS_PANELS[extensionId] ?? null
}