"use client";

import { useTranslation } from "react-i18next";

type DocPageKey =
  | "overview"
  | "quickstart"
  | "fundamentals"
  | "setup"
  | "sso"
  | "iframe"
  | "wallet"
  | "transfer"
  | "errors"
  | "golive";

export function useIntegrationDoc(page: DocPageKey) {
  const { t } = useTranslation("integrationDocs");

  return {
    t,
    p: (key: string) => t(`pages.${page}.${key}`),
    rows: (key: string) => t(`pages.${page}.${key}`, { returnObjects: true }) as string[][],
    list: (key: string) => t(`pages.${page}.${key}`, { returnObjects: true }) as string[],
    header: (key: string) => t(`headers.${key}`, { returnObjects: true }) as string[],
  };
}
