32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
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>
|
|
);
|
|
}
|