import { createContext, useContext } from "react";
import { fileReviewRowState, } from "./file-review-status.js";
const DEFAULT_VALUE = {
    changeSetsById: new Map(),
};
/** Context that supplies the session's change sets to stamped tool rows. */
export const FileReviewContext = createContext(DEFAULT_VALUE);
/**
 * The review state a stamped tool row should badge, or `null` for no badge
 * (unstamped row, unknown set, or a file absent from its set — see
 * {@link fileReviewRowState} for the honest-degradation rules).
 *
 * @param fileChangeSetId The row's `ToolCall.file_change_set_id` (may be "").
 * @param rowPath The row's file path (the presenter's primary arg), used to
 *   resolve this file's verdict once the set is decided.
 */
export function useFileReviewRowState(fileChangeSetId, rowPath) {
    const { changeSetsById } = useContext(FileReviewContext);
    if (!fileChangeSetId)
        return null;
    return fileReviewRowState(changeSetsById.get(fileChangeSetId), rowPath);
}
//# sourceMappingURL=FileReviewContext.js.map