feat: show validation warning description inline
This commit is contained in:
@@ -17,6 +17,9 @@ export function Content({ config, env, onTemplateSaved }: ContentProps) {
|
||||
// Validate placeholders for warning badge
|
||||
const missingPlaceholders = config.validatePlaceholders();
|
||||
const hasValidationWarnings = missingPlaceholders.length > 0;
|
||||
const warningMessage = hasValidationWarnings
|
||||
? `Missing params: ${missingPlaceholders.join(', ')}`
|
||||
: '';
|
||||
|
||||
const tabs: Array<{ id: string; label: string; badge?: string | number; badgeVariant?: 'warning' | 'danger' }> = [
|
||||
{ id: 'env', label: 'Env' },
|
||||
@@ -33,7 +36,15 @@ export function Content({ config, env, onTemplateSaved }: ContentProps) {
|
||||
return (
|
||||
<div className="bg-white rounded-xl shadow-lg border border-slate-200 overflow-hidden h-full flex flex-col">
|
||||
<div className="flex-shrink-0">
|
||||
<div className="flex items-center justify-between border-b border-slate-200 px-4 py-2">
|
||||
<Tabs tabs={tabs} activeTab={activeTab} onChange={setActiveTab} />
|
||||
{activeTab === 'template' && hasValidationWarnings && (
|
||||
<div className="flex items-center gap-2 text-sm text-amber-600 bg-amber-50 px-3 py-1.5 rounded-lg">
|
||||
<span className="font-medium">Warning:</span>
|
||||
<span>{warningMessage}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 overflow-y-auto p-4 min-h-0">
|
||||
|
||||
Reference in New Issue
Block a user