import React, { useMemo } from 'react'; import { useNavigate, Link } from 'react-router-dom'; import { Activity, Bell, Building2, KeyRound, Shield, User as UserIcon, Users, ChevronRight, Sliders, ShieldCheck, Server } from 'lucide-react'; import { Toggle, toast } from '@/components/ds'; import { useAssistantPanel } from '@/components/ai-assistant'; import { useJobPostings, usePreferences, useStaff, useUpdatePreferences, } from '@/lib/krowHooks'; import { AdminPage } from '@/pages/admin/_shell'; /** * Admin Settings — Full-width platform configuration control center. */ export default function AdminSettings() { const navigate = useNavigate(); const preferences = usePreferences(); const updatePreferences = useUpdatePreferences(); const panel = useAssistantPanel(); const { data: postings = [] } = useJobPostings(); const { data: staff = [] } = useStaff(); const clientCount = useMemo( () => new Set(postings.map((p) => p.company).filter(Boolean)).size, [postings] ); const setPreference = (key, value, message) => { updatePreferences.mutate({ [key]: value }); toast.success(message); }; return (
{/* ── 1. Hero Banner (Full Width) ───────────────────────────────── */}
Workspace Control Center

System Settings & Governance

Configure account credentials, access security policies, organizational workforce units, and system automation behavior.

Active Staff

{staff.length}

On Platform

Positions

{postings.length}

Active Roles

Clients

{clientCount}

Organizations
{/* ── 2. Two-Column Full Width Grid ─────────────────────────────── */}
{/* ── Left Column: Account & Organization ─────────────────────── */}
{/* Account & Security Card */}

Account & Security

Personal Credentials

Profile Details

Your name, email address, and platform identity information.

Security & 2FA

Password management, two-factor authentication and active sessions.

{/* Organization Management Card */}

Organization Structure

Workforce Operations

Clients & Positions

Companies and active positions currently being staffed.

{clientCount} clients · {postings.length} positions

Users & Permissions

Platform user roles and administrative permission scopes.

{staff.length} on staff
{/* Audit Log Banner */}

Audit & System Activity Log

Review all platform administrative actions, login events and security logs.

{/* ── Right Column: System Preferences & Governance ──────────────── */}
{/* System Preferences Card */}

Workspace Preferences

Automation Controls

Account Behaviors & Notifications

{ if (v) panel.open(); else panel.close(); setPreference( 'owliverDefault', v, v ? 'Owliver opens by default' : 'Owliver stays collapsed' ); }} />
setPreference( 'compactDensity', v, v ? 'Compact density on' : 'Standard density restored' )} />
setPreference( 'emailDigest', v, v ? 'Daily digest on' : 'Daily digest off' )} />
{/* Governance & Environment Note Card */}

Environment & Compliance

Environment
Production (Live)
Workspace Isolation
Enterprise Tenant #1042
Security Standard
SOC-2 Type II
Administrator configurations apply across this entire workspace environment.
); }