mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-27 22:54:18 +00:00
* feat(www): add login blocks * chore(www): restructure for blocks * chore: build registry * chore: clean up chunks * fix(www): chart categories * feat(www): big registry refactor * feat(www): update blocks * feat: complex blocks * fix: update schema * feat: sync new-york and default * fix: lint * feat: move charts * fix(www): code * fix: src path * chore: rebuild registry * fix: screenshot * fix: set new-york as default
37 lines
820 B
TypeScript
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>
|
|
)
|
|
}
|