"use client"; import React, { useState, useEffect } from "react"; import { Download } from "lucide-react"; import confetti from "canvas-confetti"; import { BoothConfig } from "@/types/booth"; import { useI18n } from "@/lib/i18n"; import { MascotGuide } from "@/components/MascotGuide"; interface ResultScreenProps { config: BoothConfig; resultImageUrl: string; providerInfo?: { provider: string; model: string; durationMs: number; fallbackTriggered: boolean; }; onStartOver?: () => void; } export const ResultScreen: React.FC = ({ config, resultImageUrl, providerInfo, onStartOver, }) => { const { t, isWeChat } = useI18n(); const [currentUrl, setCurrentUrl] = useState(""); useEffect(() => { try { confetti({ particleCount: 80, spread: 85, origin: { y: 0.65 }, colors: ["#ff6d00", "#06b6d4", "#a855f7", "#fbbf24", "#ffffff"], }); } catch (e) { // Ignore } if (typeof window !== "undefined") { setCurrentUrl(window.location.href); } }, []); const handleDownload = () => { const a = document.createElement("a"); a.href = resultImageUrl; a.download = `shanghai-karate-spooky-${Date.now()}.jpg`; document.body.appendChild(a); a.click(); document.body.removeChild(a); }; return (
{/* Top spacing */}
{/* Main Result Image Card - Compact 9:16 frame */}
{/* eslint-disable-next-line @next/next/no-img-element */} Halloween Karate Result {/* WeChat Long-Press Save Floating Badge */} {isWeChat && (
👉 {t(config.labels.wechatSaveTip)}
)}
{/* Bottom Bar: Mascot on far bottom-left, Save Button on bottom-right */}
{/* Mascot hugging the far bottom-left with speech bubble to the right and lifted higher */}
{/* Save Button on the bottom-right */}
); };