"use client";
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { FileChangeKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
import { cn } from "@stigmer/theme";
/**
 * Shared presentational atoms for the file-review surfaces — the single source
 * for the `+N −M` stat and the change-kind marker, so the review card, the
 * compact list, and the mid-run progress bar can never drift in how they render
 * a file's magnitude or kind.
 */
/**
 * The `+N −M` stat for one file (or a whole set), in the same visual vocabulary
 * as the tool-row diff stats. Renders nothing when both counts are zero — the
 * honest signal that no count exists (binary or secret-withheld changes, records
 * captured before counts were stamped) — rather than a misleading `+0 −0`.
 */
export function FileLineStats({ linesAdded, linesRemoved, }) {
    if (linesAdded === 0 && linesRemoved === 0)
        return null;
    return (_jsxs("span", { className: "shrink-0 text-xs tabular-nums", "aria-label": `${linesAdded} added, ${linesRemoved} removed`, "data-cursor-target": "file-review-line-stats", children: [_jsxs("span", { className: "text-diff-added-fg", children: ["+", linesAdded] }), " ", _jsxs("span", { className: "text-diff-removed-fg", children: ["-", linesRemoved] })] }));
}
/** The kind letter, tone, and a11y name for each wire {@link FileChangeKind}. */
const KIND_BADGE = {
    [FileChangeKind.ADD]: {
        letter: "A",
        colorClass: "text-diff-added-fg",
        label: "added",
    },
    [FileChangeKind.MODIFY]: {
        letter: "M",
        colorClass: "text-diff-hunk-header-fg",
        label: "modified",
    },
    [FileChangeKind.DELETE]: {
        letter: "D",
        colorClass: "text-diff-removed-fg",
        label: "deleted",
    },
    [FileChangeKind.RENAME]: {
        letter: "R",
        colorClass: "text-diff-hunk-header-fg",
        label: "renamed",
    },
    // A binary change is a modification whose diff is not text; the letter stays
    // M and the binary-ness is told by the row's "Keep anyway" + reason note.
    [FileChangeKind.BINARY_CHANGE]: {
        letter: "M",
        colorClass: "text-diff-hunk-header-fg",
        label: "modified (binary)",
    },
};
/**
 * The single-letter change-kind marker — the same M/A/D visual vocabulary as
 * the version-history `DiffFileList`, extended with R for captured renames.
 * The letter itself is the non-color channel; the full word is exposed to
 * assistive tech. An UNSPECIFIED kind renders nothing rather than guessing.
 */
export function FileKindBadge({ kind }) {
    const badge = KIND_BADGE[kind];
    if (!badge)
        return null;
    return (_jsx("span", { className: cn("shrink-0 font-mono text-[10px] font-bold", badge.colorClass), "aria-label": badge.label, children: badge.letter }));
}
//# sourceMappingURL=FileReviewAtoms.js.map