feat: migrate to next/image with custom openinary loader

This commit is contained in:
Mustafa Yildiz
2026-07-12 15:35:10 +03:00
parent fcfc76706c
commit bdab54a9c9
4 changed files with 55 additions and 4 deletions
+6 -3
View File
@@ -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>
)}