diff --git a/web/src/components/detail/InfoView.astro b/web/src/components/detail/InfoView.astro new file mode 100644 index 0000000..0ef9e3e --- /dev/null +++ b/web/src/components/detail/InfoView.astro @@ -0,0 +1,29 @@ +--- +import TagRow from "@component/tagRow"; + + +const { cookTime, prepTime, description, servings, rating, tags } = Astro.props + +function formatTimeMin(minutes: number) { + if (minutes === 0) return null + const h = Math.floor(minutes / 60); + const m = minutes % 60; + let result = ""; + if (h > 0) result += `${h}h`; + if (m > 0) result += `${m}m`; + if (result === "") result = "0m"; + return result; +} + +// const workTime = formatTimeMin(re.worktime) +// const waitTime = formatTimeMin(re.waittime) +--- + +
{description}
+Serves: {servings}
)} + {prepTime && ({prepTime} Prep
)} + {cookTime && ({cookTime} Cook
)} + +{re.name}
+{recipe.metadata.title ?? "Untitled Recipe"}
- +Ingredients