"use client"; import { IconCheck, IconX, IconRefresh } from "@tabler/icons-react"; import { Badge } from "@kandev/ui/badge"; import { Button } from "@kandev/ui/button"; import { Spinner } from "@kandev/ui/spinner"; import { useGitHubStatus } from "@/hooks/domains/github/use-github-status"; import type { AuthDiagnostics } from "@/lib/types/github"; function DiagnosticsOutput({ diagnostics }: { diagnostics: AuthDiagnostics }) { return (
{diagnostics.command} exit code: {diagnostics.exit_code}
{diagnostics.exit_code !== 0 && (

A non-zero exit code means the command failed. Review the output below for details.

)}
        {diagnostics.output.trim()}
      
); } export function GitHubStatusCard() { const { status, loaded, loading, refresh } = useGitHubStatus(); if (loading || !loaded) { return (
Checking GitHub connection...
); } if (!status || !status.authenticated) { return (
Not connected to GitHub

Connect using one of these methods:

  1. Environment variable — set{" "} GITHUB_TOKEN or{" "} GH_TOKEN when starting Kandev
  2. Kandev secret — add a secret named{" "} GITHUB_TOKEN in{" "} Settings > Secrets , then click Refresh above
  3. GitHub CLI — install{" "} gh and run{" "} gh auth login
{status?.diagnostics && }
); } return (
Connected as {status.username} {status.auth_method === "gh_cli" ? "gh CLI" : "PAT"}
); }