'use client'; /** * Copyright (c) Delba de Oliveira * Source: https://github.com/delbaoliveira/website/blob/59e6f181ad75751342ceaa8931db4cbcef86b018/ui/BlurImage.tsx */ import { cn } from '@/lib/utils'; import NextImage from 'next/image'; import { useState } from 'react'; type ImageProps = { imageClassName?: string; lazy?: boolean; } & React.ComponentProps; const BlurImage = (props: ImageProps) => { const { alt, src, className, imageClassName, lazy = true, ...rest } = props; const [isLoading, setIsLoading] = useState(true); return (
setIsLoading(false)} {...rest} />
); }; export { BlurImage };