jacquardSnapshot

← snapshot

1151 bytes
import type { ProvenanceLabel } from "@/lib/types";

/**
 * Whose hands made it — the signature element, rendered beside every
 * snapshot. Mixed is woven of both colors: it is both hands, not a third.
 */
export function ProvenanceBadge({ provenance }: { provenance: ProvenanceLabel }) {
  return (
    <span
      className={`jac-badge jac-badge--${provenance}`}
      title="Provenance is inside the content address; it cannot be quietly rewritten."
    >
      <span className="jac-badge-dot" aria-hidden="true" />
      {provenance}
    </span>
  );
}

/** An actor rendered with its kind's color: gold human, indigo agent. */
export function ActorBadge({
  actor,
}: {
  actor: { kind: string; id: string; display_name?: string };
}) {
  const cls =
    actor.kind === "human"
      ? "jac-badge--human"
      : actor.kind === "agent"
        ? "jac-badge--agent"
        : "jac-badge--mixed";
  return (
    <span className={`jac-badge ${cls}`} title={actor.id}>
      <span className="jac-badge-dot" aria-hidden="true" />
      {actor.display_name ?? actor.id}
      <span style={{ opacity: 0.65 }}>· {actor.kind}</span>
    </span>
  );
}