"use client"; import { useTimelineStore } from "@/stores/timeline-store"; import { useMediaStore } from "@/stores/media-store"; import { ImageTimelineTreatment } from "@/components/ui/image-timeline-treatment"; import { Button } from "@/components/ui/button"; import { Play, Pause } from "lucide-react"; import { useState } from "react"; export function PreviewPanel() { const { tracks } = useTimelineStore(); const { mediaItems } = useMediaStore(); const [isPlaying, setIsPlaying] = useState(false); // Get the first clip from the first track for preview (simplified for now) const firstClip = tracks[0]?.clips[0]; const firstMediaItem = firstClip ? mediaItems.find((item) => item.id === firstClip.mediaId) : null; // Calculate dynamic aspect ratio - default to 16:9 if no media const aspectRatio = firstMediaItem?.aspectRatio || 16 / 9; const renderPreviewContent = () => { if (!firstMediaItem) { return (
{firstMediaItem.name}
Preview: {firstMediaItem.name}
{firstMediaItem.type === "image" &&
" (with CapCut-style treatment)"}
Aspect Ratio: {aspectRatio.toFixed(2)} (
{aspectRatio > 1
? "Landscape"
: aspectRatio < 1
? "Portrait"
: "Square"}
)