@@ -9,17 +9,17 @@ import React from "react";
9
9
import { Link } from "react-router-dom" ;
10
10
import { useParams } from "react-router" ;
11
11
import cn from "classnames" ;
12
- import { makeStyles , Theme , useMediaQuery } from "@material-ui/core" ;
12
+ import { ListItem , ListItemIcon , makeStyles , Theme , useMediaQuery } from "@material-ui/core" ;
13
13
import Drawer from '@material-ui/core/Drawer' ;
14
14
import List from "@material-ui/core/List" ;
15
15
import Divider from "@material-ui/core/Divider" ;
16
16
import ListSubheader from '@material-ui/core/ListSubheader' ;
17
17
import Box from "@mui/material/Box" ;
18
18
import { Spinner } from "@postgres.ai/shared/components/Spinner" ;
19
19
import { HeaderButtons , HeaderButtonsProps } from "../HeaderButtons/HeaderButtons" ;
20
- import { BotMessage } from "../../../types/api/entities/bot" ;
21
20
import { theme } from "@postgres.ai/shared/styles/theme" ;
22
21
import { useAiBot } from "../hooks" ;
22
+ import VisibilityOffIcon from '@material-ui/icons/VisibilityOff' ;
23
23
24
24
25
25
const useStyles = makeStyles < Theme , ChatsListProps > ( ( theme ) => ( {
@@ -73,13 +73,23 @@ const useStyles = makeStyles<Theme, ChatsListProps>((theme) => ({
73
73
whiteSpace : 'nowrap' ,
74
74
textDecoration : "none" ,
75
75
flex : '0 0 2.5rem' ,
76
+ display : 'block' ,
76
77
'&:hover' : {
77
78
background : 'rgba(0, 0, 0, 0.04)'
79
+ } ,
80
+ '&:focus' : {
81
+ outline : 'none' ,
82
+ background : 'rgba(0, 0, 0, 0.04)'
78
83
}
79
84
} ,
80
85
listItemLinkActive : {
81
86
background : 'rgba(0, 0, 0, 0.04)'
82
87
} ,
88
+ listItemIcon : {
89
+ transform : 'translateY(2px)' ,
90
+ marginRight : 2 ,
91
+ minWidth : 'auto' ,
92
+ } ,
83
93
loader : {
84
94
width : '100%' ,
85
95
height : '100%' ,
@@ -165,15 +175,22 @@ export const ChatsList = (props: ChatsListProps) => {
165
175
const isActive = item . id === params . threadId
166
176
const link = linkBuilder ( item . id )
167
177
return (
168
- < Link
178
+ < ListItem
179
+ component = { Link }
169
180
to = { link }
170
181
key = { item . id }
171
182
className = { cn ( classes . listItemLink , { [ classes . listItemLinkActive ] : isActive } ) }
172
183
id = { item . id }
173
184
onClick = { ( ) => handleClick ( item . id ) }
185
+ autoFocus = { isActive }
174
186
>
187
+ < ListItemIcon
188
+ className = { classes . listItemIcon }
189
+ title = { item . is_public ? 'This thread is public' : 'This thread is private' } >
190
+ { ! item . is_public && < VisibilityOffIcon /> }
191
+ </ ListItemIcon >
175
192
{ item . content }
176
- </ Link >
193
+ </ ListItem >
177
194
)
178
195
} )
179
196
}
0 commit comments