mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 13:34:13 +03:00
* 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
17 lines
370 B
TypeScript
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",
|
|
});
|
|
}
|
|
}
|