build69
build69  /  Components  /  DocumentCompare /  Source

DocumentCompare

Two stored documents side by side in a dialog, and ONE decision (fb_56743998): the system-generated original next to the uploaded signed scan, each pane fetching its OWN file with its own loading skeleton, its own error and its own Retry, plus a footer slot for the decision button. It is a compare SHELL around DocumentViewer, not a second viewer: every pane is a DocumentViewerSurface, so the credentialed fetch-then-render, the PDF frame, the image wrapper, the explicit cannot-be-shown state, print and download all behave exactly as in the single-document viewer. DocumentCompareSurface is the dialog-less form for embedding and SSR.

3 files2 dependenciestokens resolved ✓
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"use client";

import * as React from "react";
import { cn } from "@/lib/utils";
import { surface, type Tone, type Emphasis } from "@/lib/recipes";

// DocumentCompare — Two stored documents side by side in a dialog, and ONE decision (fb_56743998): the syste
export interface DocumentCompareProps extends React.ComponentProps<"div"> {
  /** Semantic role: which accent the component uses. */
  tone?: Tone;
  /** Visual loudness: how prominent it reads. */
  emphasis?: Emphasis;
}

export function DocumentCompare({
  className,
  tone = "primary",
  emphasis = "solid",
  ...props
}: DocumentCompareProps) {
  return (
    <div
      data-slot="document-compare"
      data-tone={tone}
      data-emphasis={emphasis}
      className={cn(
        "inline-flex items-center gap-2 rounded-lg transition-colors",
        surface(tone, emphasis),
        className,
      )}
      {...props}
    />
  );
}