diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 4e86e68..053c79d 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -2,7 +2,7 @@ import React, { Suspense, lazy } from 'react'; import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; import { AppProvider } from './context/AppContext'; import { UIProvider } from './context/UIContext'; -import Layout from './components/Layout'; +import Layout from './components/layout/Layout'; const Dashboard = lazy(() => import('./pages/Dashboard')); const Chat = lazy(() => import('./pages/Chat')); diff --git a/webui/src/components/SectionPanel.tsx b/webui/src/components/SectionPanel.tsx deleted file mode 100644 index d411cfb..0000000 --- a/webui/src/components/SectionPanel.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; - -type SectionPanelProps = { - actions?: React.ReactNode; - children: React.ReactNode; - className?: string; - headerClassName?: string; - icon?: React.ReactNode; - subtitle?: React.ReactNode; - title?: React.ReactNode; -}; - -function joinClasses(...values: Array) { - return values.filter(Boolean).join(' '); -} - -const SectionPanel: React.FC = ({ - actions, - children, - className, - headerClassName, - icon, - subtitle, - title, -}) => { - return ( -
- {title || subtitle || actions || icon ? ( -
-
- {title ? ( -
- {icon} -

{title}

-
- ) : null} - {subtitle ?
{subtitle}
: null} -
- {actions ?
{actions}
: null} -
- ) : null} - {children} -
- ); -}; - -export default SectionPanel; diff --git a/webui/src/components/channel/ChannelFieldRenderer.tsx b/webui/src/components/channel/ChannelFieldRenderer.tsx index 883d8fb..2544323 100644 --- a/webui/src/components/channel/ChannelFieldRenderer.tsx +++ b/webui/src/components/channel/ChannelFieldRenderer.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Check, ShieldCheck, Users, Wifi } from 'lucide-react'; -import { CheckboxCardField, FieldBlock, TextField } from '../FormControls'; +import { CheckboxCardField, FieldBlock, TextField } from '../ui/FormControls'; import type { ChannelField, ChannelKey } from './channelSchema'; type Translate = (key: string, options?: any) => string; diff --git a/webui/src/components/channel/WhatsAppQRCodePanel.tsx b/webui/src/components/channel/WhatsAppQRCodePanel.tsx index 3c6e3dd..5a23fe5 100644 --- a/webui/src/components/channel/WhatsAppQRCodePanel.tsx +++ b/webui/src/components/channel/WhatsAppQRCodePanel.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { QrCode, Smartphone } from 'lucide-react'; import ChannelSectionCard from './ChannelSectionCard'; -import EmptyState from '../EmptyState'; +import EmptyState from '../data-display/EmptyState'; type Translate = (key: string, options?: any) => string; diff --git a/webui/src/components/channel/WhatsAppStatusPanel.tsx b/webui/src/components/channel/WhatsAppStatusPanel.tsx index a471bc5..b71f54d 100644 --- a/webui/src/components/channel/WhatsAppStatusPanel.tsx +++ b/webui/src/components/channel/WhatsAppStatusPanel.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { LogOut, Wifi, WifiOff } from 'lucide-react'; -import { FixedButton } from '../Button'; +import { FixedButton } from '../ui/Button'; import ChannelSectionCard from './ChannelSectionCard'; -import InfoTile from '../InfoTile'; -import NoticePanel from '../NoticePanel'; +import InfoTile from '../data-display/InfoTile'; +import NoticePanel from '../layout/NoticePanel'; type Translate = (key: string, options?: any) => string; diff --git a/webui/src/components/chat/ChatComposer.tsx b/webui/src/components/chat/ChatComposer.tsx index aedbfcf..6786725 100644 --- a/webui/src/components/chat/ChatComposer.tsx +++ b/webui/src/components/chat/ChatComposer.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Paperclip, Send } from 'lucide-react'; -import { TextField } from '../FormControls'; +import { TextField } from '../ui/FormControls'; type ChatComposerProps = { chatTab: 'main' | 'subagents'; diff --git a/webui/src/components/chat/SubagentSidebar.tsx b/webui/src/components/chat/SubagentSidebar.tsx index 0061f6f..56a3d6f 100644 --- a/webui/src/components/chat/SubagentSidebar.tsx +++ b/webui/src/components/chat/SubagentSidebar.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Button } from '../Button'; -import { SelectField, TextField, TextareaField } from '../FormControls'; +import { Button } from '../ui/Button'; +import { SelectField, TextField, TextareaField } from '../ui/FormControls'; import type { AgentRuntimeBadge, RegistryAgent } from './chatUtils'; type SubagentSidebarProps = { @@ -103,15 +103,15 @@ const SubagentSidebar: React.FC = ({ ); })} diff --git a/webui/src/components/chat/SubagentStreamFilters.tsx b/webui/src/components/chat/SubagentStreamFilters.tsx index 110f661..815742e 100644 --- a/webui/src/components/chat/SubagentStreamFilters.tsx +++ b/webui/src/components/chat/SubagentStreamFilters.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button } from '../Button'; +import { Button } from '../ui/Button'; type SubagentStreamFiltersProps = { agents: string[]; diff --git a/webui/src/components/config/ConfigPageChrome.tsx b/webui/src/components/config/ConfigPageChrome.tsx index 5c6b966..c7467b3 100644 --- a/webui/src/components/config/ConfigPageChrome.tsx +++ b/webui/src/components/config/ConfigPageChrome.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { RefreshCw, Save } from 'lucide-react'; -import { Button, FixedButton } from '../Button'; -import { TextField, ToolbarCheckboxField } from '../FormControls'; -import { ModalBackdrop, ModalCard, ModalHeader, ModalShell } from '../ModalFrame'; +import { Button, FixedButton } from '../ui/Button'; +import { TextField, ToolbarCheckboxField } from '../ui/FormControls'; +import CodeBlockPanel from '../data-display/CodeBlockPanel'; +import { ModalBackdrop, ModalCard, ModalHeader, ModalShell } from '../ui/ModalFrame'; type Translate = (key: string, options?: any) => string; @@ -95,18 +96,21 @@ export function ConfigSidebar({ t, }: ConfigSidebarProps) { return ( -