@@ -9,17 +9,17 @@ import React from "react";
99import { Link } from "react-router-dom" ;
1010import { useParams } from "react-router" ;
1111import cn from "classnames" ;
12- import { makeStyles , Theme , useMediaQuery } from "@material-ui/core" ;
12+ import { ListItem , ListItemIcon , makeStyles , Theme , useMediaQuery } from "@material-ui/core" ;
1313import Drawer from '@material-ui/core/Drawer' ;
1414import List from "@material-ui/core/List" ;
1515import Divider from "@material-ui/core/Divider" ;
1616import ListSubheader from '@material-ui/core/ListSubheader' ;
1717import Box from "@mui/material/Box" ;
1818import { Spinner } from "@postgres.ai/shared/components/Spinner" ;
1919import { HeaderButtons , HeaderButtonsProps } from "../HeaderButtons/HeaderButtons" ;
20- import { BotMessage } from "../../../types/api/entities/bot" ;
2120import { theme } from "@postgres.ai/shared/styles/theme" ;
2221import { useAiBot } from "../hooks" ;
22+ import VisibilityOffIcon from '@material-ui/icons/VisibilityOff' ;
2323
2424
2525const useStyles = makeStyles < Theme , ChatsListProps > ( ( theme ) => ( {
@@ -73,13 +73,23 @@ const useStyles = makeStyles<Theme, ChatsListProps>((theme) => ({
7373 whiteSpace : 'nowrap' ,
7474 textDecoration : "none" ,
7575 flex : '0 0 2.5rem' ,
76+ display : 'block' ,
7677 '&:hover' : {
7778 background : 'rgba(0, 0, 0, 0.04)'
79+ } ,
80+ '&:focus' : {
81+ outline : 'none' ,
82+ background : 'rgba(0, 0, 0, 0.04)'
7883 }
7984 } ,
8085 listItemLinkActive : {
8186 background : 'rgba(0, 0, 0, 0.04)'
8287 } ,
88+ listItemIcon : {
89+ transform : 'translateY(2px)' ,
90+ marginRight : 2 ,
91+ minWidth : 'auto' ,
92+ } ,
8393 loader : {
8494 width : '100%' ,
8595 height : '100%' ,
@@ -165,15 +175,22 @@ export const ChatsList = (props: ChatsListProps) => {
165175 const isActive = item . id === params . threadId
166176 const link = linkBuilder ( item . id )
167177 return (
168- < Link
178+ < ListItem
179+ component = { Link }
169180 to = { link }
170181 key = { item . id }
171182 className = { cn ( classes . listItemLink , { [ classes . listItemLinkActive ] : isActive } ) }
172183 id = { item . id }
173184 onClick = { ( ) => handleClick ( item . id ) }
185+ autoFocus = { isActive }
174186 >
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 >
175192 { item . content }
176- </ Link >
193+ </ ListItem >
177194 )
178195 } )
179196 }
0 commit comments