@@ -19,6 +19,7 @@ import { Spinner } from "@postgres.ai/shared/components/Spinner";
19
19
import { HeaderButtons , HeaderButtonsProps } from "../HeaderButtons/HeaderButtons" ;
20
20
import { BotMessage } from "../../../types/api/entities/bot" ;
21
21
import { theme } from "@postgres.ai/shared/styles/theme" ;
22
+ import { useAiBot } from "../hooks" ;
22
23
23
24
24
25
const useStyles = makeStyles < Theme , ChatsListProps > ( ( theme ) => ( {
@@ -30,7 +31,7 @@ const useStyles = makeStyles<Theme, ChatsListProps>((theme) => ({
30
31
[ theme . breakpoints . down ( 'sm' ) ] : {
31
32
height : '100vh!important' ,
32
33
marginTop : '0!important' ,
33
- width : 300 ,
34
+ width : 320 ,
34
35
zIndex : 9999
35
36
} ,
36
37
'& > ul' : {
@@ -54,6 +55,9 @@ const useStyles = makeStyles<Theme, ChatsListProps>((theme) => ({
54
55
} ,
55
56
listSubheaderRoot : {
56
57
background : 'white' ,
58
+ [ theme . breakpoints . down ( 'sm' ) ] : {
59
+ padding : 0
60
+ }
57
61
} ,
58
62
listItemLink : {
59
63
fontFamily : '"Roboto", "Helvetica", "Arial", sans-serif' ,
@@ -91,8 +95,6 @@ type ChatsListProps = {
91
95
onCreateNewChat : ( ) => void ;
92
96
onClose : ( ) => void ;
93
97
isDemoOrg : boolean ;
94
- loading : boolean ;
95
- chatsList : BotMessage [ ] | null ;
96
98
onLinkClick ?: ( targetThreadId : string ) => void ;
97
99
} & HeaderButtonsProps
98
100
@@ -101,13 +103,14 @@ export const ChatsList = (props: ChatsListProps) => {
101
103
isOpen,
102
104
onCreateNewChat,
103
105
onClose,
104
- chatsList,
105
- loading,
106
106
withChatVisibilityButton,
107
107
onSettingsClick,
108
108
onLinkClick,
109
109
onConsoleClick
110
110
} = props ;
111
+
112
+ const { chatsList, chatsListLoading : loading } = useAiBot ( ) ;
113
+
111
114
const classes = useStyles ( props ) ;
112
115
const params = useParams < { org ?: string , threadId ?: string } > ( ) ;
113
116
const matches = useMediaQuery ( theme . breakpoints . down ( 'sm' ) ) ;
0 commit comments