From 7141d2992aa732a5415ee8801d4edf05e705ecf6 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 30 Mar 2025 13:57:04 +0800 Subject: [PATCH] . --- apps/blogai/components/header.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 }) { {/* 占位 + 删除按钮 */}