// Copyright: © 2026 TWWIM UG. All rights reserved. (www.twwim.com) /** * WelcomeSection — section toggle + delay/hold + per-locale welcome phrase * editors. Operates on the nested `form.attention.welcome` branch. * * @layer Presentation */ import type { Dispatch, SetStateAction } from 'react'; import { LOCALES, type FormState, type TFunction } from '../lib/constants'; import { NumberInput } from './NumberInput'; import { PhraseListEditor } from './PhraseListEditor'; interface WelcomeSectionProps { form: FormState; setForm: Dispatch>; t: TFunction; } export function WelcomeSection({ form, setForm, t }: WelcomeSectionProps) { const welcome = form.attention.welcome; const sectionOn = welcome.enabled; const updateWelcome = (changes: Partial): void => { setForm({ ...form, attention: { ...form.attention, welcome: { ...welcome, ...changes }, }, }); }; return (

{t('tenants.pluginSettings.welcomeSection')}

{t('tenants.pluginSettings.welcomeSectionHint')}

{t('tenants.pluginSettings.welcomeEnabled')}

{t('tenants.pluginSettings.welcomeEnabledHint')}

updateWelcome({ delaySeconds: v })} /> updateWelcome({ holdSeconds: v })} />
{LOCALES.map(({ code, labelKey }) => ( updateWelcome({ messages: { ...welcome.messages, [code]: next }, }) } addPlaceholder={t('tenants.pluginSettings.phraseAddWelcomePlaceholder')} addLabel={t('tenants.pluginSettings.phraseAdd')} removeLabel={t('tenants.pluginSettings.phraseRemove')} emptyHint={t('tenants.pluginSettings.phraseEmptyHint')} /> ))}
); }