Files
buzz/components/image.tsx
T
dmgnr a31c8fbb54
Build and Push Image / build-backend (push) Successful in 52s
Build and Push Image / build-frontend (push) Successful in 2m8s
Build and Push Image / push (push) Successful in 1m24s
chore: oxc
2026-06-10 01:44:11 +07:00

29 lines
557 B
TypeScript
Executable File

"use client";
import NextImage from "next/image";
import { useState } from "react";
import { cn } from "@/lib/utils";
export default function Image({
src,
alt,
className = "",
...props
}: React.ComponentProps<typeof NextImage>) {
const [isLoaded, setIsLoaded] = useState(false);
return (
<NextImage
src={src}
alt={alt}
className={cn(
"opacity-0 transition-opacity duration-600",
isLoaded && "opacity-100",
className,
)}
onLoad={() => setIsLoaded(true)}
{...props}
/>
);
}