mirror of
https://github.com/vercel/commerce.git
synced 2025-06-06 08:16:59 +00:00
67 lines
2.2 KiB
TypeScript
67 lines
2.2 KiB
TypeScript
import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
|
|
import { GridTileImage } from 'components/grid/tile';
|
|
|
|
export function GallerySkeleton({
|
|
images
|
|
}: {
|
|
images: { src: string; altText: string }[];
|
|
}) {
|
|
const buttonClassName =
|
|
'h-full px-6 transition-all ease-in-out flex items-center justify-center cursor-not-allowed';
|
|
|
|
return (
|
|
<form>
|
|
<div className="relative aspect-square h-full max-h-[550px] w-full overflow-hidden">
|
|
{images.length > 1 ? (
|
|
<div className="absolute bottom-[15%] flex w-full justify-center">
|
|
<div className="mx-auto flex h-11 items-center rounded-full border border-white bg-neutral-50/80 text-neutral-500 backdrop-blur-sm dark:border-black dark:bg-neutral-900/80">
|
|
<button
|
|
aria-label="Previous product image"
|
|
aria-disabled
|
|
disabled
|
|
className={buttonClassName}
|
|
>
|
|
<ArrowLeftIcon className="h-5" />
|
|
</button>
|
|
<div className="mx-1 h-6 w-px bg-neutral-500"></div>
|
|
<button
|
|
aria-label="Next product image"
|
|
aria-disabled
|
|
disabled
|
|
className={buttonClassName}
|
|
>
|
|
<ArrowRightIcon className="h-5" />
|
|
</button>
|
|
</div>
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
|
|
{images.length > 1 ? (
|
|
<ul className="my-12 flex items-center flex-wrap justify-center gap-2 overflow-auto py-1 lg:mb-0">
|
|
{images.map((image) => {
|
|
return (
|
|
<li key={image.src} className="h-20 w-20">
|
|
<button
|
|
aria-label="Select product image"
|
|
aria-disabled
|
|
disabled
|
|
className="h-full w-full cursor-not-allowed"
|
|
>
|
|
<GridTileImage
|
|
alt={image.altText}
|
|
src={image.src}
|
|
width={80}
|
|
height={80}
|
|
isInteractive={false}
|
|
/>
|
|
</button>
|
|
</li>
|
|
);
|
|
})}
|
|
</ul>
|
|
) : null}
|
|
</form>
|
|
);
|
|
}
|