From f2c6bbe9eab0e11da981c60b6859f51f702c06d3 Mon Sep 17 00:00:00 2001 From: Nathan Lamy Date: Tue, 26 Aug 2025 00:44:19 +0200 Subject: [PATCH] fix: meal registered status --- app/components/repas/menu-card.tsx | 37 ++++++++++++++++++------------ 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/app/components/repas/menu-card.tsx b/app/components/repas/menu-card.tsx index c1851ea..be4376b 100644 --- a/app/components/repas/menu-card.tsx +++ b/app/components/repas/menu-card.tsx @@ -6,9 +6,7 @@ import { CookingPot, Icon, Carrot, - LogIn, CalendarCheck, - Check, CheckCheck, Loader2, } from "lucide-react"; @@ -30,7 +28,13 @@ const getCourseIcon = (courseName: string) => { return ; }; -export function DailyMenu({ meals, refetchMeals }: { meals: Meal[]; refetchMeals: () => Promise }) { +export function DailyMenu({ + meals, + refetchMeals, +}: { + meals: Meal[]; + refetchMeals: () => Promise; +}) { if (meals.length === 0) { return (
@@ -103,18 +107,21 @@ export function DailyMenu({ meals, refetchMeals }: { meals: Meal[]; refetchMeals ))}
- {meal.submittable && - (meal.isRegistered ? ( - - ) : isLoading ? ( + {meal.isRegistered && ( + + )} + {credentials && + !meal.isRegistered && + meal.submittable && + (isLoading ? (