{ const m=[...form.msgs]; m[idx]=e.target.value; setForm({...form,msgs:m}); }}
onFocus={()=>setFocusMsgIdx(idx)}
onBlur={()=>setFocusMsgIdx(null)}
fullWidth multiline minRows={8} disabled={locked}
helperText={`${(form.msgs[idx]||'').length} chars`}
sx={{ width:'100%' }}
/>
) : (
(useHtml && quillReady && window.ReactQuill) ? (
setFocusMsgIdx(idx)} onBlur={()=>setFocusMsgIdx(null)} style={{ width:'100%' }}>
{ quillRefs.current[idx]=el; }}
theme="snow"
value={form.msgs[idx]}
onChange={(val)=>{ const m=[...form.msgs]; m[idx]=val; setForm({...form, msgs:m}); }}
modules={quillModules}
readOnly={locked}
style={{ minHeight:300, width:'100%' }}
/>
) : (
{ const m=[...form.msgs]; m[idx]=e.target.value; setForm({...form,msgs:m}); }}
fullWidth multiline minRows={8} disabled
helperText="Editor loading…"
/>
)
)}