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: "Stored encrypted by Kandev. Workspace automation and managed task GitHub HTTPS/gh act as your account.", icon: IconKey, }, { value: "cli" as const, label: "GitHub CLI account", description: "Resolved from one named host account when needed. Managed tasks receive a scoped brokered identity; host Git is not inherited unless selected below.", icon: IconTerminal2, }, { value: "app" as const, label: "GitHub App", description: "Stored App credentials mint short-lived installation tokens. Managed tasks receive a scoped brokered App identity for allowed repositories.", 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 ( ); })} ); }