2024-03-27 00:03:58 +03:00
|
|
|
import { isSafari } from "react-device-detect";
|
|
|
|
|
import { Skeleton } from "../ui/skeleton";
|
2024-05-07 17:00:25 +03:00
|
|
|
import { cn } from "@/lib/utils";
|
2024-03-27 00:03:58 +03:00
|
|
|
|
|
|
|
|
export default function ImageLoadingIndicator({
|
|
|
|
|
className,
|
|
|
|
|
imgLoaded,
|
|
|
|
|
}: {
|
|
|
|
|
className?: string;
|
|
|
|
|
imgLoaded: boolean;
|
|
|
|
|
}) {
|
|
|
|
|
if (imgLoaded) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return isSafari ? (
|
2024-05-14 18:06:44 +03:00
|
|
|
<div className={cn("pointer-events-none bg-gray-300", className)} />
|
2024-03-27 00:03:58 +03:00
|
|
|
) : (
|
2024-05-07 17:00:25 +03:00
|
|
|
<Skeleton className={cn("pointer-events-none", className)} />
|
2024-03-27 00:03:58 +03:00
|
|
|
);
|
|
|
|
|
}
|