diff --git a/app/components/sidebar/HistoryItem.tsx b/app/components/sidebar/HistoryItem.tsx index 3f58735f8..4c284359d 100644 --- a/app/components/sidebar/HistoryItem.tsx +++ b/app/components/sidebar/HistoryItem.tsx @@ -1,5 +1,4 @@ import * as Dialog from '@radix-ui/react-dialog'; -import { useEffect, useRef, useState } from 'react'; import { type ChatHistoryItem } from '~/lib/persistence'; import WithTooltip from '~/components/ui/Tooltip'; @@ -11,78 +10,46 @@ interface HistoryItemProps { } export function HistoryItem({ item, onDelete, onDuplicate, exportChat }: HistoryItemProps) { - const [hovering, setHovering] = useState(false); - const hoverRef = useRef(null); - - useEffect(() => { - let timeout: NodeJS.Timeout | undefined; - - function mouseEnter() { - setHovering(true); - - if (timeout) { - clearTimeout(timeout); - } - } - - function mouseLeave() { - setHovering(false); - } - - hoverRef.current?.addEventListener('mouseenter', mouseEnter); - hoverRef.current?.addEventListener('mouseleave', mouseLeave); - - return () => { - hoverRef.current?.removeEventListener('mouseenter', mouseEnter); - hoverRef.current?.removeEventListener('mouseleave', mouseLeave); - }; - }, []); - return ( -
+
{item.description}
- {hovering && ( -
- +
+ +
- )} + +