Wire homepage images to Meshkee slots and publish the catalog.
The dashboard can refresh these keys from the live site. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
1272977923
commit
1c2d1eb31c
@@ -0,0 +1,37 @@
|
||||
type SlotImageProps = {
|
||||
url: string;
|
||||
title?: string | null;
|
||||
linkUrl?: string | null;
|
||||
alt?: string;
|
||||
className?: string;
|
||||
imgClassName?: string;
|
||||
};
|
||||
|
||||
export function SlotImage({
|
||||
url,
|
||||
title,
|
||||
linkUrl,
|
||||
alt,
|
||||
className,
|
||||
imgClassName = "block h-full w-full object-cover",
|
||||
}: SlotImageProps) {
|
||||
const img = (
|
||||
// Meshkee slot URLs are used as-is; do not route through next/image.
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img src={url} alt={alt ?? title ?? ""} className={imgClassName} />
|
||||
);
|
||||
|
||||
if (linkUrl) {
|
||||
return (
|
||||
<a href={linkUrl} className={className}>
|
||||
{img}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
if (className) {
|
||||
return <div className={className}>{img}</div>;
|
||||
}
|
||||
|
||||
return img;
|
||||
}
|
||||
Reference in New Issue
Block a user