"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { QuestionMarkCircleIcon } from "@heroicons/react/24/outline";
const HELP_BASE_URL = (process.env.NEXT_PUBLIC_HELP_URL ?? "").replace(/\/$/, "");
function guessHelpTopicFromPath(pathname: string) {
const segment = pathname.split("/").filter(Boolean)[0];
return segment || "dashboard";
}
export function HelpLink({ topicOverride }: { topicOverride?: string }) {
const pathname = usePathname();
const topic = topicOverride ?? guessHelpTopicFromPath(pathname || "/");
const href = HELP_BASE_URL ? `${HELP_BASE_URL}/t/${encodeURIComponent(topic)}` : `/einstellungen`;
return (
);
}