mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 20:17:45 +00:00
refactor(ui): update imports to use new domain directories
- update App.tsx imports from layout/ - update page imports from health/, layout/, shared/ - wrap providers/variants in useMemo for stable deps
This commit is contained in:
+2
-2
@@ -3,9 +3,9 @@ import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { Toaster } from 'sonner';
|
||||
import { queryClient } from '@/lib/query-client';
|
||||
import { ThemeProvider } from '@/components/theme-provider';
|
||||
import { ThemeProvider } from '@/components/layout/theme-provider';
|
||||
import { PrivacyProvider } from '@/contexts/privacy-context';
|
||||
import { Layout } from '@/components/layout';
|
||||
import { Layout } from '@/components/layout/layout';
|
||||
|
||||
// Eager load: HomePage (initial route)
|
||||
import { HomePage } from '@/pages';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Phase 03: REST API Routes & CRUD
|
||||
*/
|
||||
|
||||
import { AccountsTable } from '@/components/accounts-table';
|
||||
import { AccountsTable } from '@/components/account/accounts-table';
|
||||
import { useAccounts } from '@/hooks/use-accounts';
|
||||
|
||||
export function AccountsPage() {
|
||||
|
||||
@@ -22,9 +22,9 @@ import {
|
||||
RefreshCw,
|
||||
} from 'lucide-react';
|
||||
import { ProfileEditor } from '@/components/profile-editor';
|
||||
import { ProfileCreateDialog } from '@/components/profile-create-dialog';
|
||||
import { ProfileCreateDialog } from '@/components/profiles/profile-create-dialog';
|
||||
import { useProfiles, useDeleteProfile } from '@/hooks/use-profiles';
|
||||
import { ConfirmDialog } from '@/components/confirm-dialog';
|
||||
import { ConfirmDialog } from '@/components/shared/confirm-dialog';
|
||||
import type { Profile } from '@/lib/api-client';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { CopyButton } from '@/components/ui/copy-button';
|
||||
|
||||
@@ -12,10 +12,10 @@ import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { Check, X, RefreshCw, Sparkles, Zap, GitBranch, Trash2 } from 'lucide-react';
|
||||
import { QuickSetupWizard } from '@/components/quick-setup-wizard';
|
||||
import { AddAccountDialog } from '@/components/add-account-dialog';
|
||||
import { AddAccountDialog } from '@/components/account/add-account-dialog';
|
||||
import { ProviderEditor } from '@/components/cliproxy/provider-editor';
|
||||
import { ProviderLogo } from '@/components/cliproxy/provider-logo';
|
||||
import { ProxyStatusWidget } from '@/components/proxy-status-widget';
|
||||
import { ProxyStatusWidget } from '@/components/monitoring/proxy-status-widget';
|
||||
import {
|
||||
useCliproxy,
|
||||
useCliproxyAuth,
|
||||
@@ -191,8 +191,8 @@ export function CliproxyPage() {
|
||||
isFirstAccount: boolean;
|
||||
} | null>(null);
|
||||
|
||||
const providers = authData?.authStatus || [];
|
||||
const variants = variantsData?.variants || [];
|
||||
const providers = useMemo(() => authData?.authStatus || [], [authData?.authStatus]);
|
||||
const variants = useMemo(() => variantsData?.variants || [], [variantsData?.variants]);
|
||||
|
||||
// Auto-select first provider if nothing selected
|
||||
const effectiveProvider = useMemo(() => {
|
||||
|
||||
@@ -2,9 +2,9 @@ import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { RefreshCw, Terminal, Copy, Cpu } from 'lucide-react';
|
||||
import { HealthGauge } from '@/components/health-gauge';
|
||||
import { HealthStatsBar } from '@/components/health-stats-bar';
|
||||
import { HealthGroupSection } from '@/components/health-group-section';
|
||||
import { HealthGauge } from '@/components/health/health-gauge';
|
||||
import { HealthStatsBar } from '@/components/health/health-stats-bar';
|
||||
import { HealthGroupSection } from '@/components/health/health-group-section';
|
||||
import { useHealth, type HealthGroup } from '@/hooks/use-health';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { HeroSection } from '@/components/hero-section';
|
||||
import { AuthMonitor } from '@/components/auth-monitor';
|
||||
import { HeroSection } from '@/components/layout/hero-section';
|
||||
import { AuthMonitor } from '@/components/monitoring/auth-monitor';
|
||||
import { ErrorLogsMonitor } from '@/components/error-logs-monitor';
|
||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
|
||||
@@ -41,7 +41,7 @@ import {
|
||||
Wifi,
|
||||
WifiOff,
|
||||
} from 'lucide-react';
|
||||
import { CodeEditor } from '@/components/code-editor';
|
||||
import { CodeEditor } from '@/components/shared/code-editor';
|
||||
import { api } from '@/lib/api-client';
|
||||
import type { CliproxyServerConfig, RemoteProxyStatus } from '@/lib/api-client';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user