Files
accounted/components/ui/retention-notice.tsx
T
Jakob Wennberg ec27228a8e style: remove em/en dashes repo-wide, add CLAUDE.md rule against them (#890)
Em dashes (—) and en dashes (–) had spread across comments, docs, tests,
and a few UI strings, reading as AI-generated boilerplate rather than
house style. Replaced each with punctuation matching its context: colon
for explanatory clauses, comma for asides, plain hyphen for numeric/legal
ranges (e.g. "21-23§"), "to"/"till" for date ranges, parentheses for
paired-dash asides. messages/en.json and messages/sv.json were fixed by
hand together to keep sv/en in sync.

Left untouched where the dash is the functional subject rather than
decorative punctuation: date-range-parser.ts's separator regex,
charset-repair.ts's CP1252 byte-mapping table (and its test), the SIE
encoding mojibake docs, generic-csv.ts's minus-sign normalizer, the
agent system-prompt files that already instruct against em dashes, and
a golden iXBRL test fixture compared byte-for-byte.

Also fixes two bugs surfaced along the way: an off-by-one in
ApiKeysPanel's scope-label split (a leftover from an earlier partial
pass), and a charset-repair test that had lost the literal en-dash it
exists to verify.

Regenerated the agent atom seed migration (skills:generate) since 27
SKILL.md files changed. Added a CLAUDE.md rule against em/en dashes,
with an explicit carve-out for the functional-dash cases above.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 15:58:06 +02:00

77 lines
2.3 KiB
TypeScript

'use client'
import Link from 'next/link'
import { useTranslations } from 'next-intl'
import { AlertTriangle } from 'lucide-react'
import { cn } from '@/lib/utils'
import { getBranding } from '@/lib/branding/service'
interface RetentionNoticeProps {
variant: 'company' | 'account'
className?: string
}
/**
* Shared BFL retention notice shown before destructive actions that
* affect bookkeeping data. Keeps the legal copy consistent between the
* account danger zone and the company danger zone.
*
* Swedish Bokföringslagen (BFL) 7 kap. 2§ requires räkenskapsinformation
* to be retained for 7 years. Accounted is the system of record, so deleting
* a company or an account does not remove the underlying data: it only
* hides it from the UI and anonymizes PII where applicable.
*/
export function RetentionNotice({ variant, className }: RetentionNoticeProps) {
const t = useTranslations('retention_notice')
const { appName } = getBranding()
const copy =
variant === 'company'
? {
title: t('company_title'),
body: (
<>
{t('company_body_prefix', { appName: appName.toLowerCase() })}
<Link
href="/settings/backup"
className="underline underline-offset-2 hover:text-foreground"
>
{t('company_body_link')}
</Link>
{t('company_body_suffix')}
</>
),
}
: {
title: t('account_title'),
body: (
<>
{t('account_body_prefix')}
<Link
href="/settings/backup"
className="underline underline-offset-2 hover:text-foreground"
>
{t('account_body_link')}
</Link>
{t('account_body_suffix')}
</>
),
}
return (
<div
className={cn(
'rounded-lg border border-destructive/30 bg-destructive/5 p-4',
className
)}
>
<div className="flex gap-3">
<AlertTriangle className="h-5 w-5 text-destructive shrink-0 mt-0.5" />
<div className="space-y-1 text-sm">
<p className="font-medium text-destructive">{copy.title}</p>
<p className="text-muted-foreground">{copy.body}</p>
</div>
</div>
</div>
)
}