/** * activity-diff.tsx * * — renders the field-level diff of a single ActivityEvent. * * Three visual states driven by `event.action`: * - created → green "after" column only (no before) * - deleted → red "before" column only (no after) * - updated → yellow "before → after" side-by-side per field * * Consumers pass the declarative `columns` metadata array (same shape as * `TableMetadata.columns`) so labels and display types are resolved without * any internal fetch. Degrades gracefully when `columns` is empty/absent. * * Toggle: "Todos los campos / Solo cambios" (with changed-field counter). */ import * as React from 'react'; import type { ColumnDefinition } from './types'; /** * The canonical activity event shape as produced by the kernel / host backend. * Transport-agnostic — the component only reads the fields it needs. */ export interface ActivityEvent { id: string; correlation_id?: string | null; actor_id?: string | null; actor_label?: string | null; /** Storage path of the actor's avatar image, when the backend resolves one. */ actor_avatar?: string | null; addon_key: string; model: string; record_id: string; action: string; kind?: string | null; before?: Record | null; after?: Record | null; /** * Explicit diff map produced by the backend. When present, only these keys * are "changed" fields. When absent, the diff is derived from before/after. */ changes?: Record | null; summary?: string | null; occurred_at: string; } export interface ActivityDiffProps { /** The activity event to render. */ event: ActivityEvent; /** * Column metadata for the model. Used to resolve `col.label` and display * type. Pass `TableMetadata.columns` from the host's metadata cache. * Optional — field keys are shown raw when absent. */ columns?: ColumnDefinition[]; /** IANA timezone for datetime cells (org config). */ timeZone?: string; /** ISO 4217 currency for money cells (org config). */ currency?: string; /** BCP-47 locale. Defaults to 'es'. */ locale?: string; /** Class applied to the root element. */ className?: string; } /** * Renders the field-level diff of a single ActivityEvent. Shows each field * with its label (from `columns`) and value formatted using the column's * display type. Supports a toggle to show only changed fields vs. all fields. */ export declare const ActivityDiff: React.FC; //# sourceMappingURL=activity-diff.d.ts.map