feat: admin hints with auto-expiry shown in album overview

This commit is contained in:
Leon Tonhäuser committed 2026-09-11 17:30:15 +02:00
1 parent 2a5a2f3815
commit abe072b2d1
15 files changed
+2946 -1

No files matched your search

@@ -0,0 +1,31 @@
import { Megaphone } from "lucide-react";
import { formatIsoDateGerman, type Announcement } from "./service";
// Time-limited admin hints (e.g. "away at a match today"), shown at the top
// of the editorial album overview. Renders nothing when nothing is active.
export function AnnouncementBanner({ items }: { items: Announcement[] }) {
if (items.length === 0) {
return null;
}
return (
<div className="space-y-3" role="status">
{items.map((item) => (
<div
key={item.id}
className="bg-primary/10 border border-primary/30 rounded-xl p-4 flex gap-3"
>
<Megaphone className="h-5 w-5 shrink-0 text-primary-600 mt-0.5" aria-hidden="true" />
<div className="min-w-0 space-y-0.5">
<p className="text-sm font-semibold">Hinweis von Leon Tonhäuser Sportfotografie</p>
<p className="text-sm whitespace-pre-line break-words">{item.message}</p>
<p className="text-xs text-muted-foreground">
bezogen auf den {formatIsoDateGerman(item.eventDate)}
</p>
</div>
</div>
))}
</div>
);
}