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

Add styling for ThreadList component and apply it in the render

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

+ 7 - 0
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/ThreadList.module.scss

@@ -0,0 +1,7 @@
+.thread-list :global {
+  li {
+    &:hover {
+      background-color: var(--bs-secondary-bg) !important;
+    }
+  }
+}

+ 5 - 1
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/ThreadList.tsx

@@ -5,6 +5,10 @@ import type { IThreadRelationHasId } from '~/features/openai/interfaces/thread-r
 import { useAiAssistantSidebar } from '../../../stores/ai-assistant';
 import { useSWRxThreads } from '../../../stores/thread';
 
+import styles from './ThreadList.module.scss';
+
+const moduleClass = styles['thread-list'] ?? '';
+
 
 export const ThreadList: React.FC = () => {
   const { openChat, data: aiAssistantSidebarData } = useAiAssistantSidebar();
@@ -21,7 +25,7 @@ export const ThreadList: React.FC = () => {
 
   return (
     <>
-      <ul className="list-group">
+      <ul className={`list-group ${moduleClass}`}>
         {threads?.map(thread => (
           <li
             onClick={() => { openChatHandler(thread) }}