import type { ConfigResponse } from '../../../../../packages/api-contracts/src/index.js'; import { SwitchField } from '../../components/form-fields.js'; import { SettingsCard } from './settings-card.js'; import { createSafetyDraft, safetyRisks, validateSafetyDraft, type SafetyDraft } from './settings-model.js'; import { useConfigCard } from './use-config-card.js'; export function SafetyCard({ config }: { config: ConfigResponse }) { const card = useConfigCard(config, { id: 'safety', toDraft: createSafetyDraft, validate: validateSafetyDraft, risks: safetyRisks, }); const isLive = !card.persisted.dryRun; return ( {isLive ? 'Sending live' : 'Dry run'}} title="Safety" > {/* State first: the operator should read what is happening now before being shown the control that changes it. */}

{isLive ? 'Messages are being sent to real people.' : 'No messages are being sent.'} {isLive ? 'Every evaluated post can produce a real outbound message, subject to the pacing limits.' : 'Posts are evaluated and replies are drafted, but nothing is delivered to Reddit.'}

card.update({ ...card.draft, dryRun })} tone="critical" />
); }