Merge remote-tracking branch into main, resolving conflicts
Kept the local branch's homepage implementation (Meshkee product/category
API integration, redesigned header, Swiper carousels, hardcoded local
slider/banner images) as the source of truth for all conflicting sections,
since it reflects the most recent explicit direction.
Folded in the remote's non-conflicting additions: the static-image-slot
types/helpers in lib/meshkee.ts, the SlotImage component, and the
/meshkee/static-image-slots catalog route. These aren't wired into any
page yet since the live API's slot key ("home-hero") doesn't match the
keys this code expects ("slider", etc.) — worth reconciling once that's
settled.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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