mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
21 lines
440 B
TypeScript
21 lines
440 B
TypeScript
|
import { isSafari } from "react-device-detect";
|
||
|
import { Skeleton } from "../ui/skeleton";
|
||
|
|
||
|
export default function ImageLoadingIndicator({
|
||
|
className,
|
||
|
imgLoaded,
|
||
|
}: {
|
||
|
className?: string;
|
||
|
imgLoaded: boolean;
|
||
|
}) {
|
||
|
if (imgLoaded) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
return isSafari ? (
|
||
|
<div className={`bg-gray-300 pointer-events-none ${className ?? ""}`} />
|
||
|
) : (
|
||
|
<Skeleton className={`pointer-events-none ${className ?? ""}`} />
|
||
|
);
|
||
|
}
|