Build the Salar Store storefront and connect products, blogs, and home specials to the Meshkee API.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
2783305f07
commit
7d26eaa838
@@ -0,0 +1,27 @@
|
||||
import Image, { type StaticImageData } from "next/image";
|
||||
|
||||
type Props = {
|
||||
src: string | StaticImageData;
|
||||
alt?: string;
|
||||
className?: string;
|
||||
sizes?: string;
|
||||
priority?: boolean;
|
||||
};
|
||||
|
||||
export function Media({ src, alt = "", className = "", sizes, priority }: Props) {
|
||||
const remote = typeof src === "string" && /^https?:\/\//.test(src);
|
||||
|
||||
return (
|
||||
<div className={`relative overflow-hidden bg-zinc-100 ${className}`}>
|
||||
<Image
|
||||
src={src}
|
||||
alt={alt}
|
||||
fill
|
||||
sizes={sizes ?? "100vw"}
|
||||
className="object-cover"
|
||||
priority={priority}
|
||||
unoptimized={remote}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user