diff --git a/apps/blogai/components/header.tsx b/apps/blogai/components/header.tsx index 8e6380f..beddace 100644 --- a/apps/blogai/components/header.tsx +++ b/apps/blogai/components/header.tsx @@ -39,6 +39,8 @@ import { LogoAI } from '@/components/chat' import { useState } from "react"; +import { Trash2 } from "lucide-react"; + import { BadgeInfo, Tags, @@ -163,6 +165,22 @@ export function DetailPageHeader({ data }: { data: any }) { } }; + // ✅ 删除函数 + const handleDelete = () => { + if (loading) return; + + const confirmed = window.confirm("确定要删除模型吗?"); + if (confirmed) { + setLoading(true); + // 模拟删除流程(实际调用 API 或其他逻辑) + // await deleteComponent(data.id); + console.log("模型已删除"); + + setLoading(false); + } + }; + + // 处理图标路径 const isImagePath = typeof data?.icon === "string" && @@ -219,7 +237,7 @@ export function DetailPageHeader({ data }: { data: any }) { {/* 占位 + 删除按钮 */}