"use client"; import { cn } from "@/lib/utils"; import { Manrope } from "next/font/google"; import React, { useRef, useEffect, useState } from "react"; import { RoughNotation, RoughNotationGroup } from "react-rough-notation"; import { useInView } from "framer-motion"; import { useSidebar } from "@/components/ui/sidebar"; const manrope = Manrope({ subsets: ["latin"], weight: ["400", "700"] }); export function AnimatedEmptyState() { const ref = useRef(null); const isInView = useInView(ref); const { state } = useSidebar(); const [shouldShowHighlight, setShouldShowHighlight] = useState(false); const [layoutStable, setLayoutStable] = useState(true); // Track sidebar state changes and manage highlight visibility useEffect(() => { // Set layout as unstable when sidebar state changes setLayoutStable(false); setShouldShowHighlight(false); // Wait for layout to stabilize after sidebar transition const stabilizeTimer = setTimeout(() => { setLayoutStable(true); }, 300); // Wait for sidebar transition (200ms) + buffer return () => clearTimeout(stabilizeTimer); }, [state]); // Re-enable highlights after layout stabilizes and component is in view useEffect(() => { if (layoutStable && isInView) { const showTimer = setTimeout(() => { setShouldShowHighlight(true); }, 100); // Small delay to ensure layout is fully settled return () => clearTimeout(showTimer); } else { setShouldShowHighlight(false); } }, [layoutStable, isInView]); return (

SurfSense

Let's Start Surfing {" "} through your knowledge base.

); }