14 lines
381 B
TypeScript
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;
|
|
}
|