fix: copy button uses plain number format (nr. 42 din 11.03.2026)
Strips company prefix and leading zeros from registry number. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -524,7 +524,9 @@ function CopyNumberButton({ entry }: { entry: RegistryEntry }) {
|
||||
|
||||
const handleCopy = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
const text = `nr. ${entry.number} din ${formatDate(entry.date)}`;
|
||||
// Extract plain number: "BTG-0042/2026" → "42", "US-0123/2026" → "123"
|
||||
const plain = entry.number.replace(/^[A-Z]+-0*/, "").replace(/\/.*$/, "");
|
||||
const text = `nr. ${plain} din ${formatDate(entry.date)}`;
|
||||
void navigator.clipboard.writeText(text).then(() => {
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 1500);
|
||||
|
||||
Reference in New Issue
Block a user