refactor(admin): split multi-tenant page.tsx into colocated components
Extract types, constants, helpers, and UI pieces (LoadingSkeleton, EmptyState, StatCard, ComplianceRing, Modal, TenantCard, CreateTenantModal, EditTenantModal, TenantDetailModal) into _components/ and _types.ts to bring page.tsx from 1663 LOC to 432 LOC (under the 500 hard cap). Behavior preserved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
import type { CreateNamespaceForm, CreateTenantForm, SortField, StatusFilter } from '../_types'
|
||||
|
||||
export const FALLBACK_TENANT_ID = '00000000-0000-0000-0000-000000000001'
|
||||
export const FALLBACK_USER_ID = '00000000-0000-0000-0000-000000000001'
|
||||
export const API_BASE = '/api/sdk/v1/multi-tenant'
|
||||
|
||||
export const STATUS_OPTIONS = [
|
||||
{ value: 'active', label: 'Aktiv' },
|
||||
{ value: 'suspended', label: 'Suspendiert' },
|
||||
{ value: 'inactive', label: 'Inaktiv' },
|
||||
]
|
||||
|
||||
export const FILTER_OPTIONS: { value: StatusFilter; label: string }[] = [
|
||||
{ value: 'all', label: 'Alle' },
|
||||
{ value: 'active', label: 'Aktiv' },
|
||||
{ value: 'suspended', label: 'Suspendiert' },
|
||||
{ value: 'inactive', label: 'Inaktiv' },
|
||||
]
|
||||
|
||||
export const SORT_OPTIONS: { value: SortField; label: string }[] = [
|
||||
{ value: 'name', label: 'Name' },
|
||||
{ value: 'score', label: 'Score' },
|
||||
{ value: 'risk', label: 'Risiko' },
|
||||
]
|
||||
|
||||
export const ISOLATION_LEVELS = [
|
||||
{ value: 'shared', label: 'Shared' },
|
||||
{ value: 'isolated', label: 'Isoliert' },
|
||||
{ value: 'dedicated', label: 'Dediziert' },
|
||||
]
|
||||
|
||||
export const DATA_CLASSIFICATIONS = [
|
||||
{ value: 'public', label: 'Oeffentlich' },
|
||||
{ value: 'internal', label: 'Intern' },
|
||||
{ value: 'confidential', label: 'Vertraulich' },
|
||||
{ value: 'restricted', label: 'Eingeschraenkt' },
|
||||
]
|
||||
|
||||
export const RISK_ORDER: Record<string, number> = {
|
||||
LOW: 0,
|
||||
MEDIUM: 1,
|
||||
HIGH: 2,
|
||||
CRITICAL: 3,
|
||||
}
|
||||
|
||||
export const EMPTY_CREATE_FORM: CreateTenantForm = {
|
||||
name: '',
|
||||
slug: '',
|
||||
max_users: 100,
|
||||
llm_quota_monthly: 10000,
|
||||
}
|
||||
|
||||
export const EMPTY_NAMESPACE_FORM: CreateNamespaceForm = {
|
||||
name: '',
|
||||
slug: '',
|
||||
isolation_level: 'shared',
|
||||
data_classification: 'internal',
|
||||
}
|
||||
Reference in New Issue
Block a user