No customers yet.
: ( +{archived ? "No archived customers." : "No customers yet."}
: ( <> -| Customer | Licences | Site |
|---|
| Church | Product | Domain | Server | Version | Last heartbeat | Status |
|---|---|---|---|---|---|---|
| {d.customer?.name} ({d.shortName}){d.isDemo && demo} | {PRODUCT_NAMES[d.product as keyof typeof PRODUCT_NAMES] || d.product} | {d.domain} | {d.server?.name} | {d.install?.version || d.version || "–"} | {d.installId ? ago(d.install?.lastHeartbeatAt) : not registered} | |
| {d.customer?.name} ({d.shortName}){d.isDemo && demo} | {PRODUCT_NAMES[d.product as keyof typeof PRODUCT_NAMES] || d.product} | {d.domain} | {d.server?.name} | {d.install?.version || d.version || "–"} | {d.installId ? ago(d.install?.lastHeartbeatAt) : not registered} |
No installs on servers yet.
: !shown.length &&No installs match.
} diff --git a/frontend/src/components/EmailList.tsx b/frontend/src/components/EmailList.tsx new file mode 100644 index 0000000..3cb89ba --- /dev/null +++ b/frontend/src/components/EmailList.tsx @@ -0,0 +1,41 @@ +"use client"; + +import React from "react"; +import { Plus, X } from "lucide-react"; + +/** The addresses in a stored value ("a@x.org, b@x.org"). */ +export const emailsOf = (value: string | null | undefined) => String(value || "").split(/[\s,;]+/).map(s => s.trim()).filter(Boolean); + +/** + * Hub 2.12.0: one or more email addresses, one per row, with + to add another. The value is the + * comma-separated list the API stores ("a@x.org, b@x.org"); empty rows are dropped when saved. + */ +export function EmailList({ id, label, value, onChange, placeholder, max = 10 }: { + id: string; label: string; value: string; onChange: (v: string) => void; placeholder?: string; max?: number; +}) { + // Keep an empty row while typing: split on commas only, so a half-typed address stays put. + const rows = value === "" ? [""] : value.split(",").map(s => s.trim()); + const set = (next: string[]) => onChange(next.join(", ")); + return ( +Blank: the site's admin contact, then the customer's email. Now going to {c.sendsTo || "nobody (add one)"}.
Invoices, statements and receipts go to every address here. Blank: the site's admin contact, then the customer's email. Now going to {c.sendsTo || "nobody (add one)"}.
+