fix(i18n): localize CopyId aria-label and toast in portal dashboard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 18:26:32 +02:00
co-authored by Claude Sonnet 4.6
parent ff6273af64
commit a7be6b7c79
+3 -2
View File
@@ -272,16 +272,17 @@ function Stat({ label, value }: { label: string; value: string }) {
function CopyId({ id }: { id: string }) {
const [copied, setCopied] = useState(false);
const t = useT();
return (
<button
type="button"
aria-label="Copy order ID"
aria-label={t({ en: "Copy order ID", sv: "Kopiera order-ID" })}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
void navigator.clipboard.writeText(id).then(() => {
setCopied(true);
toast.success(`Copied ${id.slice(0, 8)}…`);
toast.success(t({ en: `Copied ${id.slice(0, 8)}…`, sv: `Kopierad ${id.slice(0, 8)}…` }));
setTimeout(() => setCopied(false), 2000);
});
}}