diff --git a/src/App.tsx b/src/App.tsx index 8e9dbb6..ae95aee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,6 +8,8 @@ import { App as MapApp } from './pages/map'; import { App as PromptApp } from './pages/prompt'; import { App as AiAgentApp } from './pages/ai-agent'; import { App as UserApp } from './pages/user'; +import { App as ChatApp } from './pages/chat-manager'; + import '@abearxiong/container/dist/container.css'; export const App = () => { @@ -28,6 +30,7 @@ export const App = () => { } /> } /> } /> + } /> 404} /> 404} /> diff --git a/src/modules/layout/index.tsx b/src/modules/layout/index.tsx new file mode 100644 index 0000000..9e50a64 --- /dev/null +++ b/src/modules/layout/index.tsx @@ -0,0 +1,26 @@ +import { AiMoudle } from '@/pages/ai-chat'; +import { Outlet } from 'react-router-dom'; + +type LayoutMainProps = { + title?: React.ReactNode; + children?: React.ReactNode; +}; +export const LayoutMain = (props: LayoutMainProps) => { + return ( +
+
{props.title}
+
+
+
+ +
+
+ +
+
+ ); +}; diff --git a/src/pages/ai-chat/AiModule.tsx b/src/pages/ai-chat/AiModule.tsx index 8c39c8a..7e80aef 100644 --- a/src/pages/ai-chat/AiModule.tsx +++ b/src/pages/ai-chat/AiModule.tsx @@ -1,7 +1,7 @@ import { useShallow } from 'zustand/react/shallow'; import { useAiStore } from './store/ai-store'; import { CloseOutlined, HistoryOutlined } from '@ant-design/icons'; -import { Button, Form, Input } from 'antd'; +import { Button, Form, Input, Tooltip } from 'antd'; import { useEffect } from 'react'; import { TextArea } from '../container/components/TextArea'; import clsx from 'clsx'; @@ -48,9 +48,11 @@ export const AiMoudle = () => {
-

Ai Moudle

-
- +

Ai Moudle

+
+ + +
diff --git a/src/pages/chat-manager/history/List.tsx b/src/pages/chat-manager/history/List.tsx new file mode 100644 index 0000000..bee6a7d --- /dev/null +++ b/src/pages/chat-manager/history/List.tsx @@ -0,0 +1,24 @@ +import { useShallow } from 'zustand/react/shallow'; +import { useHistoryStore } from '../store/history'; +import { useEffect } from 'react'; + +export const List = () => { + const historyStore = useHistoryStore( + useShallow((state) => { + return { + list: state.list, + getList: state.getList, + }; + }), + ); + useEffect(() => { + historyStore.getList(); + }, []); + return ( +
+ {historyStore.list.map((item) => { + return
{item.id}
; + })} +
+ ); +}; diff --git a/src/pages/chat-manager/index.tsx b/src/pages/chat-manager/index.tsx new file mode 100644 index 0000000..43eb95e --- /dev/null +++ b/src/pages/chat-manager/index.tsx @@ -0,0 +1,15 @@ +import { Navigate, Route, Routes } from 'react-router-dom'; +import { Main } from './layouts'; +import {List as HistoryList } from './history/List' + +export const App = () => { + return ( + + }> + }> + } /> + + + ); +}; + diff --git a/src/pages/chat-manager/layouts/index.tsx b/src/pages/chat-manager/layouts/index.tsx new file mode 100644 index 0000000..d577ca8 --- /dev/null +++ b/src/pages/chat-manager/layouts/index.tsx @@ -0,0 +1,25 @@ +import { PlusOutlined } from '@ant-design/icons'; +import { Button } from 'antd'; +import { Outlet, useLocation } from 'react-router'; +import { useEffect } from 'react'; +import { LayoutMain } from '@/modules/layout'; + +export const Main = () => { + const location = useLocation(); + const isEdit = location.pathname.includes('edit/list'); + return ( + + Chat + - +
diff --git a/src/pages/container/layouts/index.tsx b/src/pages/container/layouts/index.tsx index 29a0b22..2886afb 100644 --- a/src/pages/container/layouts/index.tsx +++ b/src/pages/container/layouts/index.tsx @@ -4,6 +4,8 @@ import { Outlet, useLocation } from 'react-router'; import { useContainerStore } from '../store'; import { useEffect } from 'react'; import { useShallow } from 'zustand/react/shallow'; +import { AiMoudle } from '@/pages/ai-chat'; +import { LayoutMain } from '@/modules/layout'; export const Main = () => { const containerStore = useContainerStore( @@ -17,30 +19,20 @@ export const Main = () => { const location = useLocation(); const isEdit = location.pathname.includes('edit/list'); return ( -
-
- Container -
-
-
-
- -
-
-
-
+ + Container +