import YouTube from 'react-youtube'; function getVideoId(url: string) { const regex = /(youtu.*be.*)\/(watch\?v=|embed\/|v|shorts|)(.*?((?=[&#?])|$))/gm; return regex.exec(url)[3]; } export default function YoutubePreview({ url }: { url: string }) { const id = getVideoId(url); return (
e.stopPropagation()} className="relative mt-2 flex flex-col overflow-hidden rounded-lg">
); }