()
| 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(), |
no outgoing calls
no test coverage detected