import { AgentChatSurface, markAgentChatHomeHandoff, sendToAgentChat, } from "@agent-native/core/client/agent-chat"; import { useT } from "@agent-native/core/client/i18n"; import { IconChartBar, IconDatabase, IconSettings } from "@tabler/icons-react"; import { useEffect } from "react"; import { scheduleFormsRoutePrewarm } from "@/lib/route-prewarm"; import { TAB_ID } from "@/lib/tab-id"; export function AskPage() { const t = useT(); useEffect(() => { function handleChatRunning(event: Event) { const detail = (event as CustomEvent).detail; if (detail?.isRunning === true) markAgentChatHomeHandoff("forms"); } const cancelRoutePrewarm = scheduleFormsRoutePrewarm(); window.addEventListener("agentNative.chatRunning", handleChatRunning); return () => { cancelRoutePrewarm(); window.removeEventListener("agentNative.chatRunning", handleChatRunning); }; }, []); function prefillSuggestion(message: string) { sendToAgentChat({ message, submit: false, chatTarget: "local" }); } const suggestions = [ { label: t("home.pillForms"), prompt: "@forms", icon: IconDatabase, }, { label: t("home.pillAnalytics"), prompt: "analytics", icon: IconChartBar, }, { label: t("home.pillConfiguration"), prompt: "configuration", icon: IconSettings, }, ]; return (
{t("home.description")}