import Link from "next/link";
import { BookOpen, ExternalLink, MapPin, Pin } from "lucide-react";
import { dateTile, eventWhen, plain, type Announcement, type Devotional, type EventItem } from "@/lib/content";
import { truncate } from "@/lib/text";
/** An announcement in a list (Home, Announcements): pinned ones say so. */
export function AnnouncementCard({ a }: { a: Announcement }) {
return (
{a.imageUrl && }
{truncate(plain(a.body), 140)}
{a.membersOnly &&Members only
} ); } /** One event in a list: the date tile, title, when and where, and where it comes from. */ export function EventCard({ e }: { e: EventItem }) { const tile = dateTile(e.startsAt, e.timezone); return ({eventWhen(e)}
{e.location &&Cancelled
: e.source === "events" &&Register on the Events site
}{d.passage.reference} ({d.passage.translation})
{truncate(plain(d.passage.text), 140)}
); } /** "Register on the Events site" (or More info): a link out, never a registration here (ยง7). */ export function RegisterButton({ e }: { e: EventItem }) { if (!e.registration || e.cancelled) return null; return ( {e.registration.label}