"use client"; import React from "react"; export type MessageKind = "update" | "news"; const OPTIONS: { value: MessageKind; label: string; description: string }[] = [ { value: "update", label: "Event update", description: "About an event the recipients registered for — a reminder, venue or time change, what to bring. Goes to everyone selected.", }, { value: "news", label: "News & announcements", description: "Promoting events or sharing news. Only goes to people who opted in, and includes an unsubscribe link.", }, ]; /** POPIA: what kind of bulk message this is — decides who it may go to (see utils/privacy.js). */ export function MessageKindPicker({ value, onChange, name }: { value: MessageKind; onChange: (kind: MessageKind) => void; name: string }) { return (
Message type
{OPTIONS.map(o => ( ))}
); } /** "Matched 12 recipient(s)." plus how many news skipped. */ export function matchedText(res: { matched?: number; skipped?: number } | null | undefined) { const skipped = res?.skipped ?? 0; return `Matched ${res?.matched ?? 0} recipient(s).${skipped ? ` ${skipped} skipped — not opted in to news or unsubscribed.` : ""}`; }