Files
shadcn-ui/deprecated/www/components/block-image.tsx
shadcn 2bfc1c82ba chore: deprecate www (#8629)
* chore: deprecate www

* chore: updates

* fix
2025-10-29 20:50:55 +04:00

37 lines
820 B
TypeScript

import Image from "next/image"
import { cn } from "@/lib/utils"
export function BlockImage({
name,
width = 1440,
height = 900,
className,
}: Omit<React.ComponentProps<typeof Image>, "src" | "alt"> & { name: string }) {
return (
<div
className={cn(
"relative aspect-[1440/900] w-full overflow-hidden rounded-lg",
className
)}
>
<Image
src={`/r/styles/new-york/${name}-light.png`}
alt={name}
width={width}
height={height}
className="object-cover dark:hidden"
data-image="light"
/>
<Image
src={`/r/styles/new-york/${name}-dark.png`}
alt={name}
width={width}
height={height}
className="hidden object-cover dark:block"
data-image="dark"
/>
</div>
)
}