// 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(() => {
    const interval = setInterval(() => {
      router.refresh();
    }, 500);

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

  return <>{children}</>;
}
