frigate/web/src/utils/browserUtil.ts
Josh Hawkins 03da70cb81
Refactor and clean up i18n (#17198)
* clean up i18n

* fix key

* fix key
2025-03-17 06:26:01 -06:00

18 lines
420 B
TypeScript

import copy from "copy-to-clipboard";
import { t } from "i18next";
import { toast } from "sonner";
export function shareOrCopy(url: string, title?: string) {
if (window.isSecureContext && "share" in navigator) {
navigator.share({
url: url,
title: title,
});
} else {
copy(url);
toast.success(t("toast.copyUrlToClipboard", { ns: "common" }), {
position: "top-center",
});
}
}