"use client"; import { IconBrandAzure, IconExternalLink } from "@tabler/icons-react"; import { Button } from "@kandev/ui/button"; import { Tooltip, TooltipContent, TooltipTrigger } from "@kandev/ui/tooltip"; import { useAppStore } from "@/components/state-provider"; import { useAzureDevOpsTaskPullRequests } from "@/hooks/domains/azure-devops/use-azure-devops-task-pull-requests"; import { getAzureDevOpsPullRequestPresentation } from "./azure-devops-status"; const TONE_CLASS = { success: "border-green-500/40 text-green-700 dark:text-green-300", danger: "border-destructive/40 text-destructive", warning: "border-amber-500/40 text-amber-700 dark:text-amber-300", muted: "text-muted-foreground", info: "border-cyan-500/40 text-cyan-700 dark:text-cyan-300", }; export function AzureDevOpsTaskPullRequestChip({ taskId }: { taskId: string | null }) { const workspaceId = useAppStore((state) => state.workspaces.activeId); const pullRequests = useAzureDevOpsTaskPullRequests(workspaceId, taskId); const first = pullRequests[0]; if (!first) return null; const presentation = getAzureDevOpsPullRequestPresentation(first); const suffix = pullRequests.length > 1 ? ` +${pullRequests.length - 1}` : ""; const label = `Azure PR ${first.pullRequestId}: ${presentation.label}${suffix}`; return (

{first.title}

{presentation.label}

); }