Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

595 B
Raw Blame
import { useCallback } from "react";
import { useTranslation } from "react-i18next";
import type { AuthProvider } from "./auth-methods";

export function useProviderName(customName: string | null | undefined) {
  const { t } = useTranslation();

  return useCallback(
    (provider: AuthProvider) => {
      if (provider === "google") return t("auth:providers.google");
      if (provider === "github") return t("auth:providers.github");
      if (provider === "discord") return t("auth:providers.discord");
      return customName || t("auth:providers.sso");
    },
    [customName, t],
  );
}