/** * Main dashboard component for Smart Montage Planner * Provides overview and control of the montage planning process */ import { AlertCircle, Download, Play, Settings, Sparkles, Upload } from "lucide-react" import { useTranslation } from "react-i18next" import { Alert, AlertDescription } from "@/components/ui/alert" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Progress } from "@/components/ui/progress" import { useMontagePlanner } from "../../hooks/use-montage-planner" import { ExportFormat, MONTAGE_STYLES } from "../../types" import { PlanViewer } from "./plan-viewer" import { ProjectAnalyzer } from "./project-analyzer" import { Suggestions } from "./suggestions" export function PlannerDashboard() { const { t } = useTranslation() const { // State videos, fragments, currentPlan, selectedStyle, targetDuration, error, // Status isAnalyzing, isGenerating, isOptimizing, hasVideos, hasFragments, hasPlan, canGeneratePlan, canOptimizePlan, isBusy, // Progress progress, progressMessage, // Statistics videoCount, fragmentCount, totalVideoDuration, planDuration, utilizationRate, // Actions startAnalysis, generatePlan, optimizePlan, applyPlanToTimeline, exportPlan, reset, clearError, // Helpers formatDuration, getStyleName, } = useMontagePlanner() const handleApplyToTimeline = () => { applyPlanToTimeline() // TODO: Show success notification } const handleExport = () => { exportPlan(ExportFormat.JSON) // TODO: Show export dialog with format options } return (
{/* Header */}

{t("montage-planner.title")}

{t("montage-planner.description")}

{hasPlan && ( <> )}
{/* Error Alert */} {error && ( {error} )} {/* Progress Bar */} {isBusy && (
{progressMessage} {Math.round(progress)}%
)} {/* Main Content */}
{/* Project Overview */} {t("common.projectOverview")} {t("common.currentProjectStatistics")}
{t("common.videos")} {videoCount}
{t("common.totalDuration")} {formatDuration(totalVideoDuration)}
{t("common.fragmentsDetected")} {fragmentCount}
{t("common.utilizationRate")} {utilizationRate.toFixed(1)}%
{/* Montage Style */} {t("montage-planner.planning.style")} {t("montage-planner.planning.preferences")}

{getStyleName(selectedStyle)}

{(MONTAGE_STYLES as any)[selectedStyle]?.description}

{targetDuration && (
{t("montage-planner.planning.duration")} {formatDuration(targetDuration)}
)} {hasPlan && (
{t("common.planDuration")} 10 ? "text-yellow-600" : ""} > {formatDuration(planDuration)}
)}
{/* Actions */} {t("common.actions")} {t("montage-planner.navigation.planning")}
{/* Analysis Results */} {hasFragments && } {/* Plan Viewer */} {hasPlan && currentPlan && } {/* Suggestions */} {hasPlan && }
) }