);
}
function Footer() {
return (
);
}
function SupportBot() {
const [open, setOpen] = useState(false);
const [messages, setMessages] = useState([
{ who: "bot", text: "Hi — I'm the tcviz assistant. This is a preview; a full support bot will go live soon. How can I help?" }
]);
const [input, setInput] = useState("");
const scrollRef = useRef(null);
useEffect(() => {
if (scrollRef.current) scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}, [messages, open]);
const quick = [
"Installation on Power BI Desktop",
"Licensing & seats",
"Compatibility with Fabric",
"Request a demo"
];
const send = (text) => {
if (!text || !text.trim()) return;
const me = { who: "me", text: text.trim() };
setMessages((m) => [...m, me]);
setInput("");
setTimeout(() => {
setMessages((m) => [
...m,
{
who: "bot",
text: "Thanks — a human from TC will pick this up. In the meantime you can also reach us at support@tcviz.com."
}
]);
}, 600);
};
return (
{open && (
TC Support
Preview · replies in under 4h
{messages.map((m, i) => (
{m.text}
))}
{quick.map((q) => (
))}
setInput(e.target.value)}
onKeyDown={(e) => e.key === "Enter" && send(input)}
/>
ENTER