/**
 * Pure visibility rule for the "Raw Request" tab. Extracted so it can be
 * unit-tested without rendering React. The tab appears only when all three
 * are true: anthropic format, full view mode, strip toggle enabled.
 */
export function shouldShowRawRequestTab(
  apiFormat: string,
  viewMode: "simple" | "full",
  strip: boolean,
): boolean {
  return apiFormat === "anthropic" && viewMode === "full" && strip;
}

/**
 * Pure visibility rule for the "Diff with Raw" button in the Headers tab.
 * The button only makes sense when the user is in full mode (where the
 * `Raw Headers` tab is shown) and we actually captured raw headers.
 */
export function shouldShowHeadersDiffButton(
  viewMode: "simple" | "full",
  hasRawHeaders: boolean,
): boolean {
  return viewMode === "full" && hasRawHeaders;
}

/**
 * Pure visibility rule for the "Diff with Raw" button in the Request tab.
 * Mirrors the conditions for the `Raw Request` tab itself: full mode plus
 * the strip toggle being on for an anthropic-format request. We also need
 * an actual raw request body to diff against.
 */
export function shouldShowRequestDiffButton(
  apiFormat: string,
  viewMode: "simple" | "full",
  strip: boolean,
  hasRawRequest: boolean,
): boolean {
  return apiFormat === "anthropic" && viewMode === "full" && strip && hasRawRequest;
}
