"use client"; import Image from "next/image"; import { useMemo, useState } from "react"; import { Typography } from "poyraz-ui/atoms"; import { getYoutubeEmbedUrl, getYoutubeVideoId } from "@/lib/youtube"; type YoutubeLiteEmbedProps = { link: string; title?: string; }; export function YoutubeLiteEmbed({ link, title = "YouTube video oynatici", }: YoutubeLiteEmbedProps) { const [isLoaded, setIsLoaded] = useState(false); const [useJpgThumb, setUseJpgThumb] = useState(false); const { videoId, embedUrl } = useMemo( () => ({ videoId: getYoutubeVideoId(link), embedUrl: getYoutubeEmbedUrl(link), }), [link], ); if (!videoId || !embedUrl) { return (
Gecersiz video baglantisi.
); } if (isLoaded) { return (