feat: migrate to next/image with custom openinary loader
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React from "react";
|
||||
import Image from "next/image";
|
||||
import { MenuItem as MenuItemType } from "@/data/menu";
|
||||
|
||||
export function MenuItem({ item, onClick }: { item: MenuItemType; onClick?: () => void }) {
|
||||
@@ -34,11 +35,13 @@ export function MenuItem({ item, onClick }: { item: MenuItemType; onClick?: () =
|
||||
)}
|
||||
</div>
|
||||
{item.image && (
|
||||
<div className="shrink-0">
|
||||
<img
|
||||
<div className="shrink-0 relative w-20 h-20">
|
||||
<Image
|
||||
src={item.image}
|
||||
alt={item.name}
|
||||
className="w-20 h-20 object-cover rounded-lg shadow-sm"
|
||||
fill
|
||||
sizes="80px"
|
||||
className="object-cover rounded-lg shadow-sm"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user