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:
+3
-2
@@ -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);
|
||||
});
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user