// components/live/LiveRefreshWrapper.tsx
'use client';

import { useEffect } from 'react';
import { useRouter } from 'next/navigation';

export default function LiveRefreshWrapper({ children }: { children: React.ReactNode }) {
  const router = useRouter();

  useEffect(() => {
    // Refresh every 3 seconds for live updates
    const interval = setInterval(() => {
      router.refresh();
    }, 3000);

    return () => clearInterval(interval);
  }, [router]);

  return <>{children}</>;
}
