|
| 1 | +import type { ComponentType } from 'react' |
| 2 | +import type { LiveSettingsKey } from '@/platform/app/(shell)/_components/settings-navigation/destinations' |
| 3 | +import type { PlatformOrganization } from '@/platform/lib/data/organization-model' |
| 4 | + |
| 5 | +/** What a section receives. Its gate has already passed; its own API calls enforce the same rule. */ |
| 6 | +export interface SettingsSectionProps { |
| 7 | + organization: PlatformOrganization |
| 8 | + /** Segments after the section's key, limited to its declared `subpaths`. */ |
| 9 | + subpath: readonly string[] |
| 10 | + query: Record<string, string | string[] | undefined> |
| 11 | +} |
| 12 | + |
| 13 | +interface SettingsSectionEntry { |
| 14 | + load: () => Promise<{ default: ComponentType<SettingsSectionProps> }> |
| 15 | + subpaths?: readonly string[] |
| 16 | +} |
| 17 | + |
| 18 | +/** |
| 19 | + * One lazily loaded folder per live section, so a section's owner edits only that folder. The |
| 20 | + * `Record` makes a section missing from either side of this map and its navigation entry a |
| 21 | + * compile error. Navigation and gates live in `settings-navigation/destinations.ts`. |
| 22 | + */ |
| 23 | +export const SETTINGS_SECTIONS: Record<LiveSettingsKey, SettingsSectionEntry> = { |
| 24 | + preferences: { |
| 25 | + load: () => |
| 26 | + import( |
| 27 | + '@/platform/app/(shell)/settings/_components/sections/preferences/preferences-section' |
| 28 | + ), |
| 29 | + }, |
| 30 | + notifications: { |
| 31 | + load: () => |
| 32 | + import( |
| 33 | + '@/platform/app/(shell)/settings/_components/sections/notifications/notifications-section' |
| 34 | + ), |
| 35 | + }, |
| 36 | + 'keyboard-shortcuts': { |
| 37 | + load: () => |
| 38 | + import( |
| 39 | + '@/platform/app/(shell)/settings/_components/sections/keyboard-shortcuts/keyboard-shortcuts-section' |
| 40 | + ), |
| 41 | + }, |
| 42 | + privacy: { |
| 43 | + load: () => |
| 44 | + import('@/platform/app/(shell)/settings/_components/sections/privacy/privacy-section'), |
| 45 | + }, |
| 46 | + account: { |
| 47 | + load: () => |
| 48 | + import('@/platform/app/(shell)/settings/_components/sections/account/account-section'), |
| 49 | + }, |
| 50 | + 'knowledge-graphs': { |
| 51 | + load: () => |
| 52 | + import( |
| 53 | + '@/platform/app/(shell)/settings/_components/sections/knowledge-graphs/knowledge-graphs-section' |
| 54 | + ), |
| 55 | + }, |
| 56 | + 'recently-deleted': { |
| 57 | + load: () => |
| 58 | + import( |
| 59 | + '@/platform/app/(shell)/settings/_components/sections/recently-deleted/recently-deleted-section' |
| 60 | + ), |
| 61 | + }, |
| 62 | + members: { |
| 63 | + load: () => |
| 64 | + import('@/platform/app/(shell)/settings/_components/sections/members/members-section'), |
| 65 | + }, |
| 66 | + billing: { |
| 67 | + load: () => |
| 68 | + import('@/platform/app/(shell)/settings/_components/sections/billing/billing-section'), |
| 69 | + }, |
| 70 | + usage: { |
| 71 | + load: () => import('@/platform/app/(shell)/settings/_components/sections/usage/usage-section'), |
| 72 | + subpaths: ['events'], |
| 73 | + }, |
| 74 | + whitelabeling: { |
| 75 | + load: () => |
| 76 | + import( |
| 77 | + '@/platform/app/(shell)/settings/_components/sections/whitelabeling/whitelabeling-section' |
| 78 | + ), |
| 79 | + }, |
| 80 | + requests: { |
| 81 | + load: () => |
| 82 | + import('@/platform/app/(shell)/settings/_components/sections/requests/requests-section'), |
| 83 | + }, |
| 84 | + links: { |
| 85 | + load: () => import('@/platform/app/(shell)/settings/_components/sections/links/links-section'), |
| 86 | + }, |
| 87 | + 'audit-logs': { |
| 88 | + load: () => |
| 89 | + import('@/platform/app/(shell)/settings/_components/sections/audit-logs/audit-logs-section'), |
| 90 | + }, |
| 91 | + 'access-control': { |
| 92 | + load: () => |
| 93 | + import( |
| 94 | + '@/platform/app/(shell)/settings/_components/sections/access-control/access-control-section' |
| 95 | + ), |
| 96 | + }, |
| 97 | + sso: { |
| 98 | + load: () => import('@/platform/app/(shell)/settings/_components/sections/sso/sso-section'), |
| 99 | + }, |
| 100 | + security: { |
| 101 | + load: () => |
| 102 | + import('@/platform/app/(shell)/settings/_components/sections/security/security-section'), |
| 103 | + }, |
| 104 | + 'data-retention': { |
| 105 | + load: () => |
| 106 | + import( |
| 107 | + '@/platform/app/(shell)/settings/_components/sections/data-retention/data-retention-section' |
| 108 | + ), |
| 109 | + }, |
| 110 | + 'data-drains': { |
| 111 | + load: () => |
| 112 | + import( |
| 113 | + '@/platform/app/(shell)/settings/_components/sections/data-drains/data-drains-section' |
| 114 | + ), |
| 115 | + }, |
| 116 | +} |
0 commit comments