refactor(components): 重构 playground组件

- 移除 Data、Scene 和 IodRelevant 组件中的 Drawer
- 优化 Data、Scene 和 IodRelevant 组件的结构
- 添加 Header 组件用于展示标题和关闭按钮
- 使用 Main 组件替代原来的 ShowCard 组件
- 调整样式和布局,提高组件的可复用性和可维护性
This commit is contained in:
zhaoweijie
2025-08-23 17:03:14 +08:00
parent 6fb71b01f0
commit e640b1254d
17 changed files with 664 additions and 410 deletions

View File

@@ -249,13 +249,11 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
}, [iodSearch])
return (
<div className="flex w-full flex-col items-center p-2 px-5 pt-1 pb-4">
<div className="flex w-full flex-col items-center pt-1 px-5 pb-4">
<div className="relative z-10 flex w-full flex-col items-center justify-center gap-2 text-base">
<div className="relative flex w-full flex-row justify-center gap-2 lg:w-5/5">
<div
className={` bg-neutral-50 dark:bg-[#262626] relative w-full max-w-[65rem] p-1 backdrop-blur-lg duration-100 border border-gray-300 rounded-xl dark:border-gray-600
${temporaryChat ? "!bg-gray-200 dark:!bg-black " : ""}
`}>
className={`shadow-xl relative w-full max-w-[65rem] p-1 rounded-xl bg-gradient-to-br from-white/90 via-blue-50/90 to-cyan-50/90 backdrop-blur-lg border border-blue-100/70 cursor-pointer hover:shadow-blue-100/60 transition-all duration-500`}>
<div
className={`border-b border-gray-200 dark:border-gray-600 relative ${
form.values.image.length === 0 ? "hidden" : "block"
@@ -361,38 +359,23 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
/>
</div>
</Tooltip>
{/*<Tooltip*/}
{/* title={t("tooltip.searchIod")}*/}
{/* className="ml-3">*/}
{/* <div className="inline-flex items-center gap-2">*/}
{/* <PiNetwork*/}
{/* className={`h-5 w-5 dark:text-gray-300 `}*/}
{/* />*/}
{/* <Switch*/}
{/* value={iodSearch}*/}
{/* onChange={(e) => setIodSearch(e)}*/}
{/* checkedChildren={t("form.webSearch.on")}*/}
{/* unCheckedChildren={t("form.webSearch.off")}*/}
{/* />*/}
{/* </div>*/}
{/*</Tooltip>*/}
<Dropdown
menu={{ items: iodSearchItems }}
placement="bottom"
trigger={["click"]}
arrow>
<Button
color="purple"
color="default"
variant="filled"
size="large"
className="w-full mt-4 hover:!bg-[#0057ff1a]"
style={{
style={iodSearch ? {
color: "#0057ff",
background: "#0057ff0f",
border: "1px solid #0066ff26"
}}>
} : {}}>
<PiNetwork className="h-5 w-5" />
{iodSearch ? "开" : ""}
{iodSearch ? "开" : ""}
</Button>
</Dropdown>
</div>