"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; import { cn } from "@/lib/utils"; import { useCreateFromDocument } from "@/hooks/use-api"; import { useToast } from "@/components/ui/toast"; import { FileText, Loader2, ArrowRight, Clock, Palette, Monitor, Smartphone, Square, Wand2, } from "lucide-react"; const videoStyles = [ { id: "CINEMATIC", label: "Sinematik", emoji: "🎬" }, { id: "DOCUMENTARY", label: "Belgesel", emoji: "📹" }, { id: "EDUCATIONAL", label: "Eğitim", emoji: "📚" }, { id: "STORYTELLING", label: "Hikâye", emoji: "📖" }, { id: "NEWS", label: "Haber", emoji: "📰" }, ]; const aspectRatios = [ { id: "PORTRAIT_9_16", label: "9:16", icon: Smartphone, desc: "Shorts / Reels" }, { id: "SQUARE_1_1", label: "1:1", icon: Square, desc: "Instagram" }, { id: "LANDSCAPE_16_9", label: "16:9", icon: Monitor, desc: "YouTube" }, ]; const languages = [ { code: "tr", label: "Türkçe", flag: "🇹🇷" }, { code: "en", label: "English", flag: "🇺🇸" }, { code: "de", label: "Deutsch", flag: "🇩🇪" }, { code: "es", label: "Español", flag: "🇪🇸" }, ]; export default function DocumentToVideoPage() { const router = useRouter(); const { toast } = useToast(); const createFromDocument = useCreateFromDocument(); const [file, setFile] = useState(null); const [style, setStyle] = useState("CINEMATIC"); const [duration, setDuration] = useState(60); const [aspectRatio, setAspectRatio] = useState("PORTRAIT_9_16"); const [language, setLanguage] = useState("tr"); const handleFileChange = (e: React.ChangeEvent) => { if (e.target.files && e.target.files.length > 0) { setFile(e.target.files[0]); } }; const handleGenerate = async () => { if (!file) { toast("error", "Lütfen bir belge seçin."); return; } try { const result: any = await createFromDocument.mutateAsync({ file, language, aspectRatio, videoStyle: style, targetDuration: duration, }); toast("success", "Belge → Video projesi oluşturuldu!"); router.push(`/dashboard/projects/${result.id}`); } catch (error) { toast("error", "Proje oluşturulurken hata oluştu."); } }; return (
{/* Header */}

Belgeden Video Üret

PDF, Word, TXT vb. belgenizi yükleyin, yapay zeka içeriği tarayıp senaryolastirsin.

{/* Input */}
{/* Video Settings */}
{languages.map((l) => ( ))}
{videoStyles.map((s) => ( ))}
setDuration(Number(e.target.value))} className="w-full h-1.5 rounded-full bg-[var(--color-bg-elevated)] appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-blue-500 [&::-webkit-slider-thumb]:shadow-[0_0_12px_rgba(59,130,246,0.4)] [&::-webkit-slider-thumb]:cursor-grab" />
{aspectRatios.map((ar) => { const Icon = ar.icon; return ( ); })}

Bu işlem 1 kredi kullanır • AI senaryo + görsel üretim dahil

); }