import { useState } from "react"; import { ResultCard } from "../ResultCard"; import { CopyButton } from "../CopyButton"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faVideo, faUndo } from "@fortawesome/free-solid-svg-icons"; import { useAutoHeight } from "../../lib/useAutoHeight"; import { NEGATIVE_VIDEO_PROMPT, type VideoPrompt, type VideoPromptType, } from "../../lib/types"; interface VideoPromptsCardProps { prompts: VideoPrompt[]; originalPrompts: VideoPrompt[]; onChange: (index: number, next: string) => void; onRegenerate: () => void; regenerating: boolean; } const TABS: VideoPromptType[] = ["Abstract", "Cinematic", "Hybrid"]; export function VideoPromptsCard({ prompts, originalPrompts, onChange, onRegenerate, regenerating, }: VideoPromptsCardProps) { const [tab, setTab] = useState("Abstract"); const idx = prompts.findIndex((p) => p.type === tab); const current = idx >= 0 ? prompts[idx] : undefined; const originalCurrent = originalPrompts.find((p) => p.type === tab); const dirty = current?.prompt !== originalCurrent?.prompt; const ref = useAutoHeight(current?.prompt ?? "", 120); return ( } title="Video Prompts" onRegenerate={onRegenerate} regenerating={regenerating} headerExtra={ current ? ( <> {dirty && originalCurrent && ( )} ) : null } >
{TABS.map((t) => { const isActive = t === tab; return ( ); })}
{current ? (