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 && }

{a.title}

{a.pinned && }

{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 (
{tile.day} {tile.month}

{e.title}

{eventWhen(e)}

{e.location &&

{e.location}

} {e.cancelled ?

Cancelled

: e.source === "events" &&

Register on the Events site

}
); } /** Home's devotional card: the title, the passage, the first lines. */ export function DevotionalCard({ d }: { d: Devotional }) { return (

{d.today ? "Today's devotional" : "The latest devotional"}

{d.title}

{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} ); }