import { IconBrandGithub, IconKey, IconTerminal2 } from "@tabler/icons-react"; import { Label } from "@kandev/ui/label"; import { RadioGroup, RadioGroupItem } from "@kandev/ui/radio-group"; import { cn } from "@/lib/utils"; export type GitHubAutomationMethod = "pat" | "cli" | "app"; const methods = [ { value: "pat" as const, label: "Personal access token", description: "Simple and portable, but automation is attributed to your personal account.", icon: IconKey, }, { value: "cli" as const, label: "GitHub CLI account", description: "Reuse one named account already authenticated on this Kandev host.", icon: IconTerminal2, }, { value: "app" as const, label: "GitHub App", description: "Isolated, short-lived credentials with explicit repository access.", icon: IconBrandGithub, }, ]; export function GitHubAuthMethodList({ value, onChange, }: { value: GitHubAutomationMethod; onChange: (value: GitHubAutomationMethod) => void; }) { return ( onChange(next as GitHubAutomationMethod)} className="grid gap-2 sm:grid-cols-3" aria-label="Connection method" > {methods.map((method) => { const Icon = method.icon; return ( ); })} ); }