// Copyright 2026 Arctel.net // SPDX-License-Identifier: Apache-2.0 'use client'; import dynamic from 'next/dynamic'; import { useEffect, useMemo } from 'react'; import { useQuery } from '@tanstack/react-query'; import { Loader2, Settings } from 'lucide-react'; import { useRouter, useSearchParams } from 'next/navigation'; import { motion } from 'motion/react'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { useAuth } from '@/components/providers/auth-provider'; import services from '@/lib/services'; import type { SystemConfig } from '@/lib/services/admin'; const tabFallback = (
); const SecurityTab = dynamic( () => import('@/components/common/settings/security-tab').then( (mod) => mod.SecurityTab, ), { loading: () => tabFallback }, ); const OperationTab = dynamic( () => import('@/components/common/settings/operation-tab').then( (mod) => mod.OperationTab, ), { loading: () => tabFallback }, ); const SystemTab = dynamic( () => import('@/components/common/settings/system-tab').then( (mod) => mod.SystemTab, ), { loading: () => tabFallback }, ); const OtherTab = dynamic( () => import('@/components/common/settings/other-tab').then( (mod) => mod.OtherTab, ), { loading: () => tabFallback }, ); const InfoTab = dynamic( () => import('@/components/common/settings/info-tab').then((mod) => mod.InfoTab), { loading: () => tabFallback }, ); const SystemStatusManager = dynamic( () => import('./components/system-status').then((mod) => mod.SystemStatusManager), { loading: () => tabFallback }, ); const OpenFlareOpsSettings = dynamic( () => import('./components/openflare-ops').then( (mod) => mod.OpenFlareOpsSettings, ), { loading: () => tabFallback }, ); function systemConfigMap(configs: SystemConfig[]) { return configs.reduce