refactor(admin): split rbac page.tsx into colocated components

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-04-14 22:50:55 +02:00
parent 82a5a388b8
commit d5287f4bdd
15 changed files with 918 additions and 801 deletions

View File

@@ -0,0 +1,23 @@
// =============================================================================
// RBAC API HELPERS
// =============================================================================
export const API = '/api/sdk/v1/rbac'
export async function apiFetch<T>(path: string, opts?: RequestInit): Promise<T> {
const res = await fetch(`${API}/${path}`, {
headers: { 'Content-Type': 'application/json' },
...opts,
})
if (!res.ok) {
const err = await res.text()
throw new Error(`HTTP ${res.status}: ${err}`)
}
return res.json()
}
export function formatDate(iso: string): string {
return new Date(iso).toLocaleString('de-DE', {
day: '2-digit', month: '2-digit', year: 'numeric',
})
}