This repository has been archived on 2026-11-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
hope-events/frontend/src/components/events/SeriesLinks.tsx
T
joshuaandClaude Opus 5.5 740897635f Event series (1.47.1)
Group separate events (Camp 2025, Camp 2026) on a series page at
/series/<slug> with upcoming and past events. Events join a series from
the event editor (copies keep it); a series can span campuses. Event
pages show "Part of ..." and "Next in this series". Signed-in people can
follow a series; the new `series` job emails followers once when a new
event in it goes live, as News & announcements (opted-in only, with
unsubscribe). Follows are in the data export and removed on
anonymising. Migration 20261028140000_event_series.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 10:29:59 +02:00

28 lines
1.5 KiB
TypeScript

import Link from "next/link";
import { ArrowRight, Layers } from "lucide-react";
import { formatDateTimeRange } from "@/lib/date";
import type { EventSeriesRef, NextInSeries } from "@/types";
/** On an event page: the series it belongs to, and the next event in that series. */
export function SeriesLinks({ series, next }: { series?: EventSeriesRef | null; next?: NextInSeries | null }) {
if (!series) return null;
return (
<div className="border rounded-xl p-4 bg-white shadow-sm space-y-2" data-testid="event-series">
<p className="text-sm text-gray-600 flex items-center gap-1.5">
<Layers className="w-4 h-4 shrink-0 text-brand-600" />
Part of <Link href={`/series/${series.slug}`} className="font-medium text-brand-700 hover:underline">{series.name}</Link>
</p>
{next && (
<Link href={`/events/${next.id}`} className="flex items-center justify-between gap-3 rounded-lg bg-brand-50 px-3 py-2 hover:bg-brand-100" data-testid="next-in-series">
<span className="min-w-0">
<span className="block text-[11px] uppercase tracking-wide text-brand-700">Next in this series</span>
<span className="block text-sm font-medium text-gray-900 truncate">{next.title}</span>
<span className="block text-xs text-gray-500">{formatDateTimeRange(next.startDate, next.endDate)}</span>
</span>
<ArrowRight className="w-4 h-4 shrink-0 text-brand-700" />
</Link>
)}
</div>
);
}