diff --git a/src/components/PackPanel.tsx b/src/components/PackPanel.tsx index 2f93cd9..a9b7ba9 100644 --- a/src/components/PackPanel.tsx +++ b/src/components/PackPanel.tsx @@ -247,7 +247,7 @@ function DetailItem({ label, value }: { label: string; value: string | number }) ); } -/* ── Pack Section (collapsible) ───────────────── */ +/* ── Pack Section ─────────────────────────────── */ function PackSection({ kind, pack, locked, lockReason, stepIndex, onRegenerateAsset }: { kind: PackKind; pack: AssetPack | undefined; @@ -256,7 +256,6 @@ function PackSection({ kind, pack, locked, lockReason, stepIndex, onRegenerateAs stepIndex: number; onRegenerateAsset: (assetId: string, userRefinement?: string) => Promise; }) { - const [open, setOpen] = useState(kind === 'patent'); const [detail, setDetail] = useState(null); const accent = PACK_ACCENT[kind]; const templates = PACK_TEMPLATES[kind]; @@ -279,15 +278,6 @@ function PackSection({ kind, pack, locked, lockReason, stepIndex, onRegenerateAs {generatedCount}/{total} - {locked && lockReason && ( @@ -296,32 +286,28 @@ function PackSection({ kind, pack, locked, lockReason, stepIndex, onRegenerateAs )} - {/* asset list — collapsible */} - {open && ( -
-
- {templates.map(template => { - const asset = pack?.assets.find(a => a.templateId === template.id); - return ( - setDetail({ template, asset })} - /> - ); - })} -
+
+
+ {templates.map(template => { + const asset = pack?.assets.find(a => a.templateId === template.id); + return ( + setDetail({ template, asset })} + /> + ); + })}
- )} +
setDetail(null)} onRegenerate={onRegenerateAsset} /> ); } -/* ── Text Template Section (collapsible) ──────── */ +/* ── Text Template Section ────────────────────── */ function TextTemplateSection({ locked }: { locked: boolean }) { - const [open, setOpen] = useState(false); const [showPromptId, setShowPromptId] = useState(null); return ( @@ -340,76 +326,61 @@ function TextTemplateSection({ locked }: { locked: boolean }) {
GPT Text -
- {open && ( -
- {TEXT_TEMPLATES.map(template => { - const isOpen = showPromptId === template.id; - return ( -
-
- text - {template.outputFormat} -
-
-
- {template.title} - - {template.kind} - - {template.required && 必备} -
-

{template.description}

- - {isOpen && ( -
-                      {template.promptTemplate}
-                    
- )} -
-
- {template.outputFormat} - 待生成 -
+
+ {TEXT_TEMPLATES.map(template => { + const isOpen = showPromptId === template.id; + return ( +
+
+ text + {template.outputFormat}
- ); - })} -
- )} +
+
+ {template.title} + + {template.kind} + + {template.required && 必备} +
+

{template.description}

+ + {isOpen && ( +
+                    {template.promptTemplate}
+                  
+ )} +
+
+ {template.outputFormat} + 待生成 +
+
+ ); + })} +
); } -/* ── Video Section (collapsible) ──────────────── */ +/* ── Video Section ────────────────────────────── */ function VideoSection({ videoLoading, primaryImage, locked, onGenerateVideo }: { videoLoading: boolean; primaryImage: GenImage; locked: boolean; onGenerateVideo: (image: GenImage, template: typeof VIDEO_TEMPLATES[number]) => void; }) { - const [open, setOpen] = useState(false); const [showPromptId, setShowPromptId] = useState(null); return ( @@ -428,67 +399,53 @@ function VideoSection({ videoLoading, primaryImage, locked, onGenerateVideo }: {
Seedance -
- {open && ( -
- {VIDEO_TEMPLATES.map(template => { - const isOpen = showPromptId === template.id; - return ( -
-
- - {template.duration}s -
-
-
- {template.title} - {template.ratio} -
-

{template.description}

- - {isOpen && ( -
-                      {template.promptTemplate}
-                    
- )} -
- +
+ {VIDEO_TEMPLATES.map(template => { + const isOpen = showPromptId === template.id; + return ( +
+
+ + {template.duration}s
- ); - })} -
- )} +
+
+ {template.title} + {template.ratio} +
+

{template.description}

+ + {isOpen && ( +
+                    {template.promptTemplate}
+                  
+ )} +
+ +
+ ); + })} +
); } @@ -509,10 +466,7 @@ function SectionNav({ active, onChange }: { active: string; onChange: (id: strin {NAV_ITEMS.map(item => (