// Copyright: © 2026 TWWIM UG. All rights reserved. (www.twwim.com) /** * IdleSection — section toggle + idle interval timings + per-locale idle * phrase editors. Operates on the nested `form.attention.idle` 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 IdleSectionProps { form: FormState; setForm: Dispatch>; t: TFunction; } export function IdleSection({ form, setForm, t }: IdleSectionProps) { const idle = form.attention.idle; const sectionOn = idle.enabled; const updateIdle = (changes: Partial): void => { setForm({ ...form, attention: { ...form.attention, idle: { ...idle, ...changes }, }, }); }; return (

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

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

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

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

updateIdle({ minIntervalSeconds: v })} /> updateIdle({ maxIntervalSeconds: v })} /> updateIdle({ displaySeconds: v })} />
{LOCALES.map(({ code, labelKey }) => ( updateIdle({ messages: { ...idle.messages, [code]: next }, }) } addPlaceholder={t('tenants.pluginSettings.phraseAddIdlePlaceholder')} addLabel={t('tenants.pluginSettings.phraseAdd')} removeLabel={t('tenants.pluginSettings.phraseRemove')} emptyHint={t('tenants.pluginSettings.phraseEmptyHint')} /> ))}
); }