import { useState } from "react"; import { HelpCircle, Send } from "lucide-react"; import { Modal } from "@/components/ui/Modal"; import { useTranslation } from "@/lib/i18n"; // Telegram group invite link. Clicking opens the Telegram app (or web) join // confirmation — Telegram has no API to add users to a group without their // consent, so an invite link is the compliant "one-click join" path. const TELEGRAM_GROUP_URL = "https://t.me/+ODpy7_7NlOE4NzA1"; /** * Floating help button (bottom-right) that opens a usage guide covering the * whole app plus a per-module how-to. All copy is i18n-keyed so it tracks the * active locale. */ // Module sections shown in the guide. Order mirrors the sidebar navigation. const SECTIONS: { titleKey: string; descKey: string; stepKeys: string[] }[] = [ { titleKey: "help.dashboard_title", descKey: "help.dashboard_desc", stepKeys: ["help.dashboard_s1", "help.dashboard_s2"] }, { titleKey: "help.sessions_title", descKey: "help.sessions_desc", stepKeys: ["help.sessions_s1", "help.sessions_s2", "help.sessions_s3"] }, { titleKey: "help.memory_title", descKey: "help.memory_desc", stepKeys: ["help.memory_s1", "help.memory_s2", "help.memory_s3"] }, { titleKey: "help.providers_title", descKey: "help.providers_desc", stepKeys: ["help.providers_s1", "help.providers_s2", "help.providers_s3"] }, { titleKey: "help.subagents_title", descKey: "help.subagents_desc", stepKeys: ["help.subagents_s1", "help.subagents_s2"] }, { titleKey: "help.settings_title", descKey: "help.settings_desc", stepKeys: ["help.settings_s1", "help.settings_s2"] }, { titleKey: "help.speedtest_title", descKey: "help.speedtest_desc", stepKeys: ["help.speedtest_s1", "help.speedtest_s2", "help.speedtest_s3"] }, ]; export function HelpButton() { const { t } = useTranslation(); const [open, setOpen] = useState(false); return ( <> setOpen(true)} className="help-fab" aria-label={t("help.button")} title={t("help.button")} > setOpen(false)} title={t("help.title")} size="xl"> {/* Project overview */} {t("help.overview_title")} {t("help.overview_desc")} {/* Per-module guide */} {t("help.modules_title")} {SECTIONS.map((s) => ( {t(s.titleKey)} {t(s.descKey)} {s.stepKeys.length > 0 && ( {s.stepKeys.map((k) => ( › {t(k)} ))} )} ))} {/* Contact / join group */} {t("help.contact_title")} {t("help.contact_desc")} {t("help.contact_join")} > ); }
{t("help.overview_desc")}
{t(s.descKey)}
{t("help.contact_desc")}