feat(github): support per-workspace GitHub App registrations (#1810)

This commit is contained in:
Carlos Florêncio
2026-07-26 10:39:08 +01:00
committed by GitHub
parent bc218dfbbe
commit 75abf779ed
347 changed files with 36471 additions and 2896 deletions
@@ -0,0 +1,35 @@
"use client";
import { IconAlertTriangle, IconCheck, IconInfoCircle } from "@tabler/icons-react";
import { Alert, AlertDescription, AlertTitle } from "@kandev/ui/alert";
import { useSearchParams } from "@/lib/routing/client-router";
import { parseGitHubCallbackResult } from "@/hooks/domains/github/use-github-app-registrations";
import { callbackNotice } from "./github-app-onboarding-model";
import { cn } from "@/lib/utils";
export function GitHubCallbackNotice({ workspaceId }: { workspaceId: string }) {
const search = useSearchParams();
const result = parseGitHubCallbackResult(search, workspaceId);
if (!result) return null;
const notice = callbackNotice(result.code);
const Icon = noticeIcon(notice.tone);
return (
<Alert
className={cn(
notice.tone === "success" && "border-green-500/40",
notice.tone === "error" && "border-destructive/50",
)}
data-testid="github-callback-notice"
>
<Icon className="h-4 w-4" />
<AlertTitle>{notice.title}</AlertTitle>
<AlertDescription>{notice.description}</AlertDescription>
</Alert>
);
}
function noticeIcon(tone: "success" | "info" | "error") {
if (tone === "success") return IconCheck;
if (tone === "info") return IconInfoCircle;
return IconAlertTriangle;
}