Create a PlaceHolder component

This commit is contained in:
Kentai Radiquum 2025-01-31 22:56:09 +05:00
parent a31c71ef7e
commit a836d24d9f
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 25 additions and 18 deletions

View file

@ -0,0 +1,18 @@
export default function Placeholder(props: {
idx: string | number;
isMobileHidden?: boolean;
}) {
return (
<a
data-type="placeholder__image"
className={`relative aspect-square min-w-48 sm:min-w-auto rounded-sm overflow-hidden ${
props.isMobileHidden ? "hidden xl:block" : ""
}`}
>
<div
id={`placeholder__image-${props.idx}-loader`}
className="w-full h-full absolute inset-0 bg-gray-400 opacity-30 animate-pulse z-[3]"
></div>
</a>
);
}