import { ToolOutlined } from "@ant-design/icons"; import type { WebViewKey, WebImageWorkbenchTool } from "../../types"; import { ossAssets } from "../../data/ossAssets"; import "../../styles/pages/toolbox.css"; const { imageBefore: toolImageBefore, imageAfter: toolImageAfter, watermarkBefore, watermarkAfter, } = ossAssets.toolbox; interface ToolboxSectionProps { onSelectView: (view: WebViewKey) => void; onOpenImageTool?: (tool: WebImageWorkbenchTool) => void; } const TOOLS = [ { key: "image-studio", icon: "🎨", name: "图片工作室", desc: "图片二次加工,调色裁剪特效风格迁移", }, { key: "lens-lab", icon: "📷", name: "镜头实验室", desc: "多视角镜头生成,不同角度与姿势", }, { key: "digital-human", icon: "🧑", name: "一键数字人", desc: "上传图片和音频,生成数字人视频", }, { key: "watermark-removal", icon: "✨", name: "去除水印", desc: "AI智能识别去除图片视频水印", }, ]; const CARDS = [ { key: "image-studio", title: "图片工作室", tag: "图片加工", icon: "🎨", features: ["二次加工", "调色", "裁剪", "风格迁移"], targetView: "imageWorkbench" as WebViewKey, render: () => (
图片加工前
原始图片
图片加工后
处理后
), }, { key: "lens-lab", title: "镜头实验室", tag: "多视角", icon: "📷", features: ["正面", "45°侧", "俯拍", "仰拍", "背面"], targetView: "imageWorkbench" as WebViewKey, render: () => (
{["正面", "45°侧", "俯拍", "仰拍", "背面"].map((angle) => (
{angle}
))}
), }, { key: "digital-human", title: "一键数字人", tag: "视频生成", icon: "🧑", features: ["上传人像", "匹配音频", "唇形同步", "生成视频"], targetView: "digitalHuman" as WebViewKey, render: () => (
STATIC
静态人像
LIVE
数字人视频
), }, { key: "watermark-removal", title: "去除水印", tag: "AI清除", icon: "✨", features: ["智能识别", "精准去除", "无损画质"], targetView: "watermarkRemoval" as WebViewKey, render: () => (
去水印前
含水印
去水印后
已清除
), }, ]; function ToolboxSection({ onSelectView, onOpenImageTool }: ToolboxSectionProps) { const handleCardClick = (targetView: WebViewKey) => { onSelectView(targetView); }; return (
{/* Left Panel */} {/* Grid Area */}
{CARDS.map((card) => (
handleCardClick(card.targetView)} >
{card.icon}
{card.title}
{card.tag}
{card.render()}
{card.features.map((feat, i) => ( {i > 0 && |} {feat} ))}
))}
); } export default ToolboxSection;