/** * BottomActions - 하단 액션 버튼 영역 * * 생성하기, 다운로드, 연동하기 버튼 컴포넌트 */ import { Sparkles, Download, Link2, Loader2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { toast } from "sonner"; import type { SlidePlan, UserSelection } from "../types/designAgent"; import { serializeSlidePlan } from "../utils/slidePlanUtils"; interface BottomActionsProps { slidePlan: SlidePlan | null; userSelection: UserSelection; isLoading: boolean; onGenerate: () => void; } export default function BottomActions({ slidePlan, userSelection, isLoading, onGenerate, }: BottomActionsProps) { const handleDownload = () => { if (!slidePlan) { toast.error("슬라이드 플랜이 없습니다. 먼저 생성하기를 눌러주세요."); return; } const json = serializeSlidePlan(slidePlan, userSelection); console.log("[Download] SlidePlan JSON:", json); // JSON 파일 다운로드 const blob = new Blob([json], { type: "application/json" }); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = `slide-plan-${Date.now()}.json`; a.click(); URL.revokeObjectURL(url); toast.success("SlidePlan JSON이 다운로드되었습니다."); }; const handleConnect = () => { toast.info("연동하기 기능은 파이프라인 연결 후 활성화됩니다."); }; return (