// Welcome / empty state + composer — chatbot-first treatment.
const { useState: useStateW, useRef: useRefW } = React;
const Welcome = ({ onAsk, onOpenSources }) => {
const D = window.OMNI_DATA;
const hour = new Date().getHours();
const greet = hour < 12 ? 'Good morning' : hour < 18 ? 'Good afternoon' : 'Good evening';
return (
{greet}, Priya.
What do you want to know?
Ask anything — I’ll figure out where the answer lives, show my work,
and back every number with its source.
Try one of these
{D.SUGGESTED.map((s, i) => {
const A = D.AGENTS.find(a => a.id === s.agent);
return (
);
})}
Or pick a source · 8 connected
{D.AGENTS.map(a => (
))}
);
};
const Composer = ({ value, setValue, onSend, mode, setMode, speed, setSpeed, onOpenSources, sourcesActive }) => {
const taRef = useRefW();
const onKey = (e) => {
if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); onSend(); }
};
const grow = (el) => { el.style.height = 'auto'; el.style.height = Math.min(160, el.scrollHeight) + 'px'; };
return (
⇧↵ newline · ↵ send
);
};
Object.assign(window, { Welcome, Composer });