// Copyright: © 2026 TWWIM UG. All rights reserved. (www.twwim.com) /** * VisibilitySection — master + per-device mount gates for the plugin widget. * * Three independent toggles: * - master enabled (suppresses the widget entirely) * - enabledOnMobile (mobile-class viewport gate) * - enabledOnWeb (desktop-class viewport gate) * * @layer Presentation */ import type { Dispatch, SetStateAction } from 'react'; import type { FormState, TFunction } from '../lib/constants'; interface VisibilitySectionProps { form: FormState; setForm: Dispatch>; t: TFunction; } export function VisibilitySection({ form, setForm, t }: VisibilitySectionProps) { const visibility = form.visibility; const updateVisibility = (changes: Partial): void => { setForm({ ...form, visibility: { ...visibility, ...changes }, }); }; return (

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

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

updateVisibility({ enabled: v })} />
updateVisibility({ enabledOnWeb: v })} /> updateVisibility({ enabledOnMobile: v })} />
); } interface ToggleRowProps { title: string; hint: string; checked: boolean; onChange: (next: boolean) => void; } function ToggleRow({ title, hint, checked, onChange }: ToggleRowProps) { return (

{title}

{hint}

); }