kv-tube/frontend/app/watch/NextVideoClient.tsx
2026-02-22 21:04:48 +07:00

14 lines
381 B
TypeScript

'use client';
import { useEffect } from 'react';
export default function NextVideoClient({ videoId }: { videoId: string }) {
useEffect(() => {
if (typeof window !== 'undefined' && videoId) {
const event = new CustomEvent('setNextVideoId', { detail: { videoId } });
window.dispatchEvent(event);
}
}, [videoId]);
return null;
}