"use client"; import { IconGitMerge } from "@tabler/icons-react"; import { useTranslation } from "react-i18next"; import { useAppStore } from "@/components/state-provider"; import { useMRActions } from "@/hooks/domains/gitlab/use-mr-actions"; import { mergeMR } from "@/lib/api/domains/gitlab-api"; import type { TaskMR } from "@/lib/types/gitlab"; import { isMRReadyToMerge } from "./mr-task-icon"; /** * Compact "Merge" action for the MR hover popover — mirrors GitHub's * PRMergeButton compact variant (immediate merge on click, no confirmation * dialog). Renders nothing unless the MR is fully ready, so the readiness * gate — not a confirmation step — is what keeps this safe. */ export function MRMergeButton({ mr }: { mr: TaskMR }) { const { t } = useTranslation(); const workspaceId = useAppStore((s) => s.workspaces.activeId); const { pendingAction, run } = useMRActions(() => {}); if (!isMRReadyToMerge(mr)) return null; const merging = pendingAction === "merge"; return ( ); }