fix(ai): live update for translation language input + preset sync
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 46s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 46s
This commit is contained in:
@@ -841,7 +841,7 @@ export function ContextualAIChat({
|
||||
<button
|
||||
key={l}
|
||||
className={`text-xs px-2.5 py-1 rounded-lg border transition-colors ${translateTarget === l ? 'bg-primary text-primary-foreground border-primary' : 'bg-card border-border hover:bg-accent'}`}
|
||||
onClick={() => setTranslateTarget(l)}
|
||||
onClick={() => { setTranslateTarget(l); setCustomLangInput(l); }}
|
||||
>{l}</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -849,8 +849,8 @@ export function ContextualAIChat({
|
||||
className="text-xs px-3 py-1.5 rounded-lg border border-border bg-card outline-none focus:border-primary w-full"
|
||||
placeholder={t('ai.action.customLang') || 'Autre langue...'}
|
||||
value={customLangInput}
|
||||
onChange={e => setCustomLangInput(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && customLangInput.trim()) { setTranslateTarget(customLangInput.trim()); setCustomLangInput('') } }}
|
||||
onChange={e => { const val = e.target.value; setCustomLangInput(val); setTranslateTarget(val); }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && translateTarget.trim()) { handleAction(action, translateTarget.trim()); } }}
|
||||
/>
|
||||
<button
|
||||
disabled={!!actionLoading || !translateTarget}
|
||||
|
||||
Reference in New Issue
Block a user