diff --git a/web/src/components/detail/IngredientTableView.astro b/web/src/components/detail/IngredientTableView.astro new file mode 100644 index 0000000..a82a5bd --- /dev/null +++ b/web/src/components/detail/IngredientTableView.astro @@ -0,0 +1,68 @@ +--- +// const { ingredients } = Astro.props + +const { class: className, ingredients } = Astro.props +const tableView = true +--- + +{!tableView && ( +
+ { + ingredients.map(ing => ( +
+

• {ing.quantity.value.value} {ing.unit || ''} {ing.name}

+
+ )) + } + +
+)} + +{tableView && ( + + + + + + + + + + { + ingredients.map((ing, index) => ( + <> + + + + + + + )) + } + +
QuantityUnitIngredient
{ing.quantity.value.value}{ing.unit || ''}{ing.name}
+)} + + + + \ No newline at end of file diff --git a/web/src/pages/recipe/[id].astro b/web/src/pages/recipe/[id].astro index fadcc70..fc78255 100644 --- a/web/src/pages/recipe/[id].astro +++ b/web/src/pages/recipe/[id].astro @@ -2,6 +2,8 @@ import Base from "@layout/Base"; import ImageCarousel from "@component/detail/ImageCarousel"; import InfoView from "@component/detail/InfoView"; +import IngredientTableView from '@component/detail/IngredientTableView' + import { Recipe } from "@tmlmt/cooklang-parser"; import { authPB } from "@data/pb"; @@ -32,7 +34,7 @@ const images = await Promise.all( />

Ingredients

- +