/* Detail pages: activity & article */ const initialsOf = (name) => name.replace(/^(dr\.?|hj\.?|h\.?)\s*/i, "").split(" ").map((w) => w[0]).filter(Boolean).slice(0, 2).join("").toUpperCase(); const ShareRow = () => (
Bagikan: e.preventDefault()} aria-label="WhatsApp"> e.preventDefault()} aria-label="Facebook"> e.preventDefault()} aria-label="Instagram">
); /* small related cards */ const RelKeg = ({ k }) => ( { e.preventDefault(); navigate("kegiatan/" + slugify(k.title)); }}>
{k.cat}
{k.d}{k.m}

{k.title}

{k.loc}
); const RelArt = ({ a }) => ( { e.preventDefault(); navigate("artikel/" + slugify(a.title)); }}>
{a.cat}

{a.title}

{a.rt}
); const NotFound = () => (

Halaman tidak ditemukan

Maaf, konten yang Anda cari tidak tersedia.

); /* -------- ACTIVITY DETAIL -------- */ const KegiatanDetail = ({ item }) => { if (!item) return ; const others = SITE.kegiatan.filter((k) => k.title !== item.title).slice(0, 3); return (
Beranda · Kegiatan · {item.cat}
{item.cat}
{item.cat} {item.loc} {item.d} {item.m} {item.year}

{item.title}

DPD Perwatusi RiauPenyelenggara kegiatan
{item.body.map((p, i) =>

{p}

)}

Kegiatan lainnya

{others.map((k) => )}
); }; /* -------- ARTICLE DETAIL -------- */ const ArtikelDetail = ({ item }) => { if (!item) return ; const doc = SITE.doctors.find((d) => d.name === item.by || d.name.split(",")[0].trim() === item.by || d.name.startsWith(item.by)); const others = SITE.articles.filter((a) => a.title !== item.title).slice(0, 3); return (
Beranda · Edukasi · {item.cat}
{item.cat} {item.date} {item.rt}

{item.title}

{initialsOf(item.by)}
{item.by}{doc ? doc.role : "Tim Edukasi Perwatusi Riau"}
{item.body.map((p, i) =>

{p}

)}

Baca juga

{others.map((a) => )}
); }; const DetailPage = ({ route }) => { if (route.type === "kegiatan") return slugify(k.title) === route.slug)} />; if (route.type === "artikel") return slugify(a.title) === route.slug)} />; return ; }; window.DetailPage = DetailPage;