create
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { StaticImageSlot } from "@/lib/types";
|
||||
|
||||
export default function FullBanner({ slot }: { slot?: StaticImageSlot }) {
|
||||
const img = slot?.images[0];
|
||||
const aspectStyle = slot?.aspectRatio ? { aspectRatio: slot.aspectRatio } : undefined;
|
||||
|
||||
const src = img?.url ?? "/images/banners/full-banner.svg";
|
||||
const href = img?.linkUrl ?? "#";
|
||||
|
||||
return (
|
||||
<section className="boxed py-2 md:py-4">
|
||||
<a href={href} className="block overflow-hidden rounded-lg border border-line">
|
||||
<img
|
||||
src={src}
|
||||
alt=""
|
||||
style={aspectStyle}
|
||||
className={`w-full object-cover ${
|
||||
aspectStyle ? "" : "aspect-[16/5] md:aspect-[16/4]"
|
||||
}`}
|
||||
/>
|
||||
</a>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user