"use client"; import { RadioGroup, RadioGroupItem } from "@kandev/ui/radio-group"; import type { TaskGitCredentialsState } from "@/hooks/domains/github/use-task-git-credentials"; import type { TaskGitCredentialsMode } from "@/lib/types/github"; import { GitHubAccessHelp } from "./github-access-help"; const taskAccessLabels: Record = { managed: "Managed workspace credentials", executor: "Inherit executor Git credentials", }; export function GitHubTaskAccessSummary({ mode, loading, error, }: Omit) { let value = taskAccessLabels[mode]; if (loading) value = "Loading task access…"; if (error) value = "Task access unavailable"; return (
Task access: {value}
); } export function GitHubTaskAccessForm({ taskAccess, value, onChange, disabled, }: { taskAccess: TaskGitCredentialsState; value: TaskGitCredentialsMode; onChange: (value: TaskGitCredentialsMode) => void; disabled?: boolean; }) { return (

Task Git access

Choose how newly launched tasks authenticate to GitHub. This does not change the workspace automation connection above.

onChange(nextValue as TaskGitCredentialsMode)} disabled={taskAccess.loading || taskAccess.error || disabled} className="gap-2" >

An executor-profile GH_TOKEN or GITHUB_TOKEN overrides managed workspace credentials for that task.

{taskAccess.error && (

Unable to load the current task access setting.

)}
); }