@@ -397,11 +397,10 @@ export default function MatchResult({
)}
{restaurant.images?.[0] && (
-
diff --git a/src/components/RestaurantCard.tsx b/src/components/RestaurantCard.tsx
index 3569dfb..e4a810a 100644
--- a/src/components/RestaurantCard.tsx
+++ b/src/components/RestaurantCard.tsx
@@ -4,6 +4,7 @@ import { useCallback, useState, useEffect } from "react";
import { Star, MapPin, Clock, ExternalLink, Flame, Bookmark, ChevronLeft, ChevronRight } from "lucide-react";
import { Restaurant } from "@/types";
import { getUserId, isRegistered } from "@/lib/userId";
+import RestaurantImage from "@/components/RestaurantImage";
interface RestaurantCardProps {
restaurant: Restaurant;
@@ -57,16 +58,15 @@ function ImageGallery({ images, name }: { images: string[]; name: string }) {
return (
-

{fadingOut !== null && (
-

setFadingOut(null)}
draggable={false}
- referrerPolicy="no-referrer"
/>
)}
diff --git a/src/components/RestaurantImage.tsx b/src/components/RestaurantImage.tsx
new file mode 100644
index 0000000..f41a558
--- /dev/null
+++ b/src/components/RestaurantImage.tsx
@@ -0,0 +1,50 @@
+"use client";
+
+import { useState, useCallback } from "react";
+import { UtensilsCrossed } from "lucide-react";
+
+interface RestaurantImageProps {
+ src: string;
+ alt: string;
+ className?: string;
+ draggable?: boolean;
+ style?: React.CSSProperties;
+ onAnimationEnd?: () => void;
+}
+
+export default function RestaurantImage({
+ src,
+ alt,
+ className = "",
+ draggable,
+ style,
+ onAnimationEnd,
+}: RestaurantImageProps) {
+ const [failed, setFailed] = useState(false);
+
+ const handleError = useCallback(() => setFailed(true), []);
+
+ if (failed) {
+ return (
+
+
+
+ );
+ }
+
+ return (
+

+ );
+}