From 60c752fad9198f7534f995328a95991566e434c8 Mon Sep 17 00:00:00 2001 From: wonder Date: Sun, 24 May 2026 21:19:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(ux):=20=E7=B4=A0=E6=9D=90=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=80=89=E6=8B=A9=E5=99=A8=E6=94=B9=E4=B8=BA=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E5=8D=A1=E7=89=87=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 每个素材类型使用内联 SVG 图标 + 文字垂直排列的卡片式选择器, 选中态高亮边框与背景色。 --- frontend/src/components/GenerateForm.tsx | 66 +++++++++++++++++++----- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/GenerateForm.tsx b/frontend/src/components/GenerateForm.tsx index 40a05ec..a0ebad9 100644 --- a/frontend/src/components/GenerateForm.tsx +++ b/frontend/src/components/GenerateForm.tsx @@ -5,6 +5,29 @@ import { mergeStyles } from '../utils/style' import StyleSelector from './StyleSelector' import PromptEditor from './PromptEditor' +const ASSET_TYPE_ICONS: Record = { + sprite: ( + + + + ), + background: ( + + + + ), + ui: ( + + + + ), + animation: ( + + + + ), +} + const ASSET_TYPES: { value: AssetType; label: string }[] = [ { value: 'sprite', label: '精灵' }, { value: 'background', label: '背景' }, @@ -58,18 +81,37 @@ export default function GenerateForm({ onSubmit, submitting }: GenerateFormProps

素材类型

-
- {ASSET_TYPES.map(t => ( - - ))} +
+ {ASSET_TYPES.map(t => { + const isSelected = assetType === t.value + return ( + + ) + })}