This commit is contained in:
parent
328855325f
commit
7141d2992a
|
|
@ -39,6 +39,8 @@ import { LogoAI } from '@/components/chat'
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { Trash2 } from "lucide-react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BadgeInfo,
|
BadgeInfo,
|
||||||
Tags,
|
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 =
|
const isImagePath =
|
||||||
typeof data?.icon === "string" &&
|
typeof data?.icon === "string" &&
|
||||||
|
|
@ -219,7 +237,7 @@ export function DetailPageHeader({ data }: { data: any }) {
|
||||||
{/* 占位 + 删除按钮 */}
|
{/* 占位 + 删除按钮 */}
|
||||||
<div className="flex-1 flex justify-end items-end">
|
<div className="flex-1 flex justify-end items-end">
|
||||||
<button
|
<button
|
||||||
onClick={() => handleClick("delete")}
|
onClick={() => handleDelete("delete")}
|
||||||
className="text-red-500 hover:text-red-700 transition"
|
className="text-red-500 hover:text-red-700 transition"
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue