fix: show helpful message when template has no parameters
Instead of an empty gap between header and Generate button, display a small info box explaining no parameters are needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { Terminal } from 'lucide-react'
|
||||||
import { useScriptGeneratorStore } from '@/store/scriptGeneratorStore'
|
import { useScriptGeneratorStore } from '@/store/scriptGeneratorStore'
|
||||||
import { ScriptParameterField } from './ScriptParameterField'
|
import { ScriptParameterField } from './ScriptParameterField'
|
||||||
import type { ScriptParametersSchema, ScriptParameter } from '@/types'
|
import type { ScriptParametersSchema, ScriptParameter } from '@/types'
|
||||||
@@ -40,6 +41,17 @@ export function ScriptParameterForm({ canGenerate }: Props) {
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (parameters.length === 0) {
|
||||||
|
return (
|
||||||
|
<div className="flex items-center gap-2 rounded-lg border border-border bg-white/[0.02] px-3 py-3">
|
||||||
|
<Terminal size={14} className="text-muted-foreground shrink-0" />
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
This template has no parameters — click <span className="text-foreground font-medium">Generate</span> to produce the script.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
{ungrouped.map(renderParam)}
|
{ungrouped.map(renderParam)}
|
||||||
|
|||||||
Reference in New Issue
Block a user