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.

938 B
Raw Blame
import { useTranslation } from "react-i18next";
import { StatusDotLine } from "@/components/project/code-hosting/status-dot-line";
import {
  describeGithubVerification,
  githubVerificationTone,
} from "@/components/project/github-integration/describe-github-verification";
import { githubVerificationMessage } from "@/components/project/github-integration/github-verification-message";
import type { VerifyGithubInstallationResponse } from "@/fetchers/github-integration/verify-github-installation";

type GithubAppStatusProps = {
  result: VerifyGithubInstallationResponse | undefined;
};

export function GithubAppStatus({ result }: GithubAppStatusProps) {
  const { t } = useTranslation();
  if (!result) return null;
  const outcome = describeGithubVerification(result);

  return (
    <StatusDotLine tone={githubVerificationTone(outcome)}>
      {githubVerificationMessage(outcome, result.message, t)}
    </StatusDotLine>
  );
}