MCPcopy Create free account
hub / github.com/CodeFox-Repo/codefox / handleDeleteChat

Function handleDeleteChat

frontend/src/components/sidebar-item.tsx:65–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63 createdAt,
64 onSelect,
65 refetchChats,
66}: SideBarItemProps) {
67 const [isDialogOpen, setIsDialogOpen] = useState(false);
68 const [renaming, setRenaming] = useState(false);
69 const [draft, setDraft] = useState(title);
70 const inputRef = useRef<HTMLInputElement>(null);
71 const router = useRouter();
72 const isSelected = currentChatId === id;
73
74 useEffect(() => setDraft(title), [title]);
75 useEffect(() => {
76 if (renaming) inputRef.current?.select();
77 }, [renaming]);
78
79 const [updateTitle] = useMutation(UPDATE_CHAT_TITLE, {
80 onCompleted: () => refetchChats(),

Callers 1

SideBarItemComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected