Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

641 B
Raw Blame
import { t } from "@/lib/i18n";
import { useStoreDispatch } from "@/state/store-select";
import type { KeyId } from "./key-catalog";
import { openKeySettings } from "./key-focus";

export function KeysLink({ id, purpose }: { id: KeyId; purpose?: KeyId }) {
  const dispatch = useStoreDispatch();
  if (typeof window !== "undefined" && window.ogb?.remoteClient?.active === true) return null;
  return (
    <button type="button" data-keys-link={purpose ?? id} onClick={() => dispatch(openKeySettings(id, purpose))}
      className="cursor-pointer font-medium text-accent-text hover:underline">
      {t("keys.openPage")}
    </button>
  );
}