"use client"; import { memo } from "react"; import { SparklesIcon } from "./icons"; import { Scissors } from "lucide-react"; interface ImageProcessingLoadingProps { type: "enhance" | "rmbg"; // 处理类型:变清晰或抠图 } /** * 图片处理加载占位符组件 * 显示类似 Gemini 生图的动态卡片效果 */ export const ImageProcessingLoading = memo(({ type }: ImageProcessingLoadingProps) => { const isEnhance = type === "enhance"; const color = isEnhance ? "blue" : "green"; const text = isEnhance ? "正在变清晰" : "正在抠图"; const icon = isEnhance ? SparklesIcon : Scissors; const Icon = icon; // 根据类型设置颜色类名 const colorClasses = isEnhance ? { ping: "bg-blue-500/20", pulse: "bg-blue-500/10", ring: "ring-blue-500/30", text: "text-blue-500", dot: "bg-blue-500", gradientFrom: "from-blue-400", gradientFromOverlay: "from-blue-500/40", gradientToOverlay: "to-blue-500/30", } : { ping: "bg-green-500/20", pulse: "bg-green-500/10", ring: "ring-green-500/30", text: "text-green-500", dot: "bg-green-500", gradientFrom: "from-green-400", gradientFromOverlay: "from-green-500/40", gradientToOverlay: "to-green-500/30", }; return (
{/* 头像 */}
{/* 文本提示 */}
{text}
{/* 图片占位符 - 170x200px */}
{/* 底层渐变背景 */}
{/* 动态模糊叠加层 1 */}
{/* 动态模糊叠加层 2 */}
{/* 噪点纹理效果 */}
{/* 模糊叠加 */}
{/* 中心图标 */}
{/* 外圈光晕 */}
{/* 图标 */}
{/* 流光效果 */}
{/* 提示文字 */} 正在处理图片,请稍候...
{/* 流光动画样式 */}
); }); ImageProcessingLoading.displayName = "ImageProcessingLoading";