From f1660036da15d98a76b400bdd0e63af18a3b6d03 Mon Sep 17 00:00:00 2001 From: Amalie Date: Tue, 6 Oct 2026 16:46:42 +0200 Subject: [PATCH] =?UTF-8?q?Har=20lagt=20til=20ratingen=20p=C3=A5=20detalje?= =?UTF-8?q?visningen=20til=20en=20oppskrift=20(58)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/recipe/RecipeDetail.tsx | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/client/src/components/recipe/RecipeDetail.tsx b/client/src/components/recipe/RecipeDetail.tsx index 5a96972..9a428b4 100644 --- a/client/src/components/recipe/RecipeDetail.tsx +++ b/client/src/components/recipe/RecipeDetail.tsx @@ -1,6 +1,7 @@ import type { Recipe } from '../../types/recipe'; import RestaurantIcon from '@mui/icons-material/Restaurant'; import AccessTimeIcon from '@mui/icons-material/AccessTime'; +import { Rating } from '@mui/material'; // Sier hva komponenten får inn. type RecipeDetailProps = { @@ -11,13 +12,27 @@ export function RecipeDetail({ recipe }: RecipeDetailProps) { return (
-
    - {recipe.tags.map((tag) => ( -
  • - {tag.tagName} -
  • - ))} -
+
+
    + {recipe.tags.map((tag) => ( +
  • + {tag.tagName} +
  • + ))} +
+ {recipe.averageRating !== null ?( +
+ + {recipe.averageRating.toFixed(1)} +
+ ) : (

Ingen rating ennå

+ )} +

{recipe.title}

{recipe.description}