'use client'; import { useEffect, useState } from 'react'; export function LoadingIndicator() { const [isVisible, setIsVisible] = useState(false); useEffect(() => { const handleStart = () => setIsVisible(true); const handleEnd = () => setIsVisible(false); window.addEventListener('beforeunload', handleStart); window.addEventListener('load', handleEnd); return () => { window.removeEventListener('beforeunload', handleStart); window.removeEventListener('load', handleEnd); }; }, []); if (!isVisible) return null; return (