| 1 | /* eslint-disable jsx-a11y/alt-text */ |
| 2 | "use client"; |
| 3 | |
| 4 | import { cn } |
| 5 | import Image from "next/image |
| 6 | import { ComponentProps, useState |
| 7 | |
| 8 | export default function ImageWithLoader |
| 9 | onLoad, |
| 10 | className, |
| 11 | ...rest |
| 12 | }: ComponentProps< |
| 13 | const [loading, |
| 14 | return ( |
| 15 | <Image |
| 16 | className={cn( |
| 17 | "duration-700 ease-in-out", |
| 18 | loading |
| 19 | ? "scale-110 blur-xl grayscale" |
| 20 | : "scale-100 blur-0 grayscale-0", |
| 21 | className |
| 22 | )} |
| 23 | {...rest} |
| 24 | onLoadingComplete={() => |
| 25 | /> |
| 26 | ); |
| 27 | } |