@@ -11,15 +11,14 @@ import {
1111import {
1212 IconClock ,
1313 IconChevronDown ,
14- IconPlus ,
1514 IconRefresh ,
1615 IconTrash ,
1716} from "@tabler/icons-react" ;
1817import { useDisclosure } from "@mantine/hooks" ;
1918import messageUtil from "@/util/MessageUtil" ;
2019import dayjs from "dayjs" ;
2120
22- export default function Topic ( { styleName } ) {
21+ export default function Topic ( { styleName, disabled } ) {
2322 const [ drawerOpened , { open : openDrawer , close : closeDrawer } ] =
2423 useDisclosure ( false ) ;
2524 const [ loading , setLoading ] = useState ( false ) ;
@@ -55,13 +54,6 @@ export default function Topic({ styleName }) {
5554 } ) ;
5655 } ;
5756
58- const setNewTopic = ( ) => {
59- messageUtil . sendMessage ( {
60- command : "setNewTopic" ,
61- } ) ;
62- closeDrawer ( ) ;
63- } ;
64-
6557 const deleteTopic = ( topicHash : string ) => {
6658 const newTopicList = topicList . filter (
6759 ( topic ) => topic . root_prompt . hash !== topicHash
@@ -82,9 +74,6 @@ export default function Topic({ styleName }) {
8274 < Flex justify = "space-between" >
8375 < Text > Devchat Topic</ Text >
8476 < Flex >
85- < ActionIcon onClick = { setNewTopic } >
86- < IconPlus size = "1rem" />
87- </ ActionIcon >
8877 < ActionIcon onClick = { refreshTopicList } >
8978 < IconRefresh size = "1rem" />
9079 </ ActionIcon >
@@ -178,6 +167,7 @@ export default function Topic({ styleName }) {
178167 </ Drawer >
179168 < ActionIcon
180169 className = { styleName }
170+ disabled = { disabled }
181171 radius = "xl"
182172 variant = "default"
183173 onClick = { openDrawer }
0 commit comments