Просмотр исходного кода

Add ThreadList component and integrate recent threads display in AiAssistantContent

Shun Miyazawa 10 месяцев назад
Родитель
Сommit
a102ce19a5

+ 12 - 0
apps/app/src/features/openai/client/components/AiAssistant/Sidebar/AiAssistantSubstance.tsx

@@ -3,8 +3,10 @@ import React, { type JSX } from 'react';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
 
 
 import { useAiAssistantManagementModal, useSWRxAiAssistants } from '../../../stores/ai-assistant';
 import { useAiAssistantManagementModal, useSWRxAiAssistants } from '../../../stores/ai-assistant';
+import { useSWRINFxRecentThreads } from '../../../stores/thread';
 
 
 import { AiAssistantTree } from './AiAssistantTree';
 import { AiAssistantTree } from './AiAssistantTree';
+import { ThreadList } from './ThreadList';
 
 
 import styles from './AiAssistantSubstance.module.scss';
 import styles from './AiAssistantSubstance.module.scss';
 
 
@@ -14,6 +16,9 @@ export const AiAssistantContent = (): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
   const { open } = useAiAssistantManagementModal();
   const { open } = useAiAssistantManagementModal();
   const { data: aiAssistants, mutate: mutateAiAssistants } = useSWRxAiAssistants();
   const { data: aiAssistants, mutate: mutateAiAssistants } = useSWRxAiAssistants();
+  const { data: recentThreads } = useSWRINFxRecentThreads();
+
+  console.log('recentThreads', recentThreads);
 
 
   return (
   return (
     <div className={moduleClass}>
     <div className={moduleClass}>
@@ -51,6 +56,13 @@ export const AiAssistantContent = (): JSX.Element => {
             />
             />
           )}
           )}
         </div>
         </div>
+
+        <div>
+          <h3 className="fw-bold grw-ai-assistant-substance-header">
+            最近の項目
+          </h3>
+          <ThreadList />
+        </div>
       </div>
       </div>
     </div>
     </div>
   );
   );

+ 9 - 0
apps/app/src/features/openai/client/components/AiAssistant/Sidebar/ThreadList.tsx

@@ -0,0 +1,9 @@
+import React from 'react';
+
+type Props = {
+  //
+}
+
+export const ThreadList: React.FC<Props> = () => {
+  return (<>ThreadList</>);
+};