frigate/web/src/utils/browserUtil.ts
Josh Hawkins 644ea7be4a
UI tweaks (#13705)
* mobile page component

* object lifecycle pane tweaks

* use mobile page component for review and search detail

* fix frigate+ dialog when using mobile page component

* small tweaks
2024-09-12 13:39:35 -06:00

17 lines
370 B
TypeScript

import copy from "copy-to-clipboard";
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("Copied URL to clipboard.", {
position: "top-center",
});
}
}