import { Frame, Label, Pill, fill, type Tone } from './frame';
import { cn } from '@/lib/cn';
// SPF, DKIM and DMARC: three checks on one email, the DMARC rollout and the sub-domain pattern.
function Check({ t = 'good' }: { t?: Tone }) {
return (
);
}
/** One message, and what each record checks on it. */
export function AuthChecks() {
return (
);
}
function Step({ name, q, a }: { name: string; q: string; a: string }) {
return (
{name}
{q}
{a}
);
}
const ROLLOUT: { p: string; text: string; t: Tone }[] = [
{ p: 'SPF and DKIM', text: 'Publish both for every service that sends as you', t: 'plain' },
{ p: 'p=none', text: 'Monitor only. Change nothing else for two weeks and read the reports', t: 'info' },
{ p: 'p=quarantine; pct=25', text: 'Bring every sender into alignment, then ramp pct to 100 over a month', t: 'watch' },
{ p: 'p=reject', text: 'When reports are clean: the strongest spoof protection', t: 'good' },
];
export function DmarcRollout() {
return (
{ROLLOUT.map((r, i) => (
Step {i + 1}
{r.p}
{r.text}
))}
);
}
const DOMAINS = [
{ d: 'acme.com', use: 'Transactional and human mail', note: 'DMARC reject after rollout', t: 'good' as Tone },
{ d: 'outreach.acme.com', use: 'Cold campaigns', note: 'Its own SPF, DKIM and DMARC', t: 'info' as Tone },
{ d: 'news.acme.com', use: 'Newsletters', note: 'Separate authentication and reputation', t: 'plain' as Tone },
];
export function SubdomainPattern() {
return (
{DOMAINS.map((d) => (
{d.d}
{d.use}
{d.note}
))}
);
}
const REGIONS: { name: string; law: string; consent: string; t: Tone; points: string[] }[] = [
{
name: 'United States',
law: 'CAN-SPAM',
consent: 'No prior consent for B2B',
t: 'good',
points: ['Truthful From and subject line', 'A physical postal address', 'Unsubscribe honoured within 10 business days'],
},
{
name: 'EU and UK',
law: 'GDPR and PECR',
consent: 'B2B on legitimate interest; B2C needs consent',
t: 'watch',
points: ['A clear business reason to write', 'Opt-outs honoured immediately', 'Say where you got their details'],
},
{
name: 'Australia',
law: 'Spam Act',
consent: 'Consent: express, inferred or implied',
t: 'watch',
points: ['Accurate sender identification', 'A working unsubscribe', 'Inferred consent is generous for B2B'],
},
{
name: 'Canada',
law: 'CASL',
consent: 'Express or implied consent required',
t: 'bad',
points: ['The strictest of the four', 'Sender identification and contact info', 'Penalties up to CAD $10M per violation'],
},
];
/** The four regimes side by side, least to most strict. */
export function ComplianceMap() {
return (
{REGIONS.map((r) => (
{r.name}
{r.law}
{r.consent}
{r.points.map((p) => (
{p}
))}
))}
);
}
const CONTACTS = [
{ name: 'Alex', company: 'Acme', out: 'Hi Alex, I saw Acme is hiring.' },
{ name: 'Sam', company: '', out: 'Hi Sam,' },
];
/** One template, rendered for two contacts. */
export function MergePreview() {
return (
Template
Hi {'{{.FirstName}}'},{'{{if .Company}}'} I saw {'{{.Company}}'} is hiring.{'{{end}}'}
{CONTACTS.map((c) => (
To {c.name} ยท Company: {c.company ? {c.company} : blank}
{c.out}
))}
);
}
function V({ children }: { children: string }) {
return {children};
}