From 0b60c791b5a5beb2408ad6619f32e4b3581a7b92 Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 16 Sep 2026 11:00:02 +0200 Subject: [PATCH] feat(card): activity timeline visible to both roles --- src/components/card/activity-timeline.tsx | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/components/card/activity-timeline.tsx diff --git a/src/components/card/activity-timeline.tsx b/src/components/card/activity-timeline.tsx new file mode 100644 index 0000000..b5fd0a5 --- /dev/null +++ b/src/components/card/activity-timeline.tsx @@ -0,0 +1,58 @@ +import { describeActivity } from "@/lib/activity/format"; +import { relativeTime } from "@/lib/time/relative"; +import type { ActivityRecord } from "@/lib/pb/types"; + +/** + * The card's history, newest first. + * + * This is the answer to "I never agreed to that date". It is shown to the + * client as well as the owner deliberately — a log only one side can see + * settles nothing. + */ +export function ActivityTimeline({ + activity, + names, +}: { + activity: ActivityRecord[]; + names: Record; +}) { + if (activity.length === 0) { + return ( +
+

+ History +

+

Nothing has changed yet.

+
+ ); + } + + return ( +
+

+ History +

+ +
    + {activity.map((row) => ( +
  1. + +

    + + {names[row.actor] ?? "Someone"} + {" "} + {describeActivity(row)} + + {" · "} + {relativeTime(row.created)} + +

    +
  2. + ))} +
+
+ ); +} \ No newline at end of file