fix: make recipe ingredinets interactive

This commit is contained in:
Max Richter
2025-11-02 20:01:01 +01:00
parent d4a7763b15
commit 098da12ac4
10 changed files with 29 additions and 23 deletions

View File

@@ -43,13 +43,13 @@ const Ingredient = (
return (
<tr key={key}>
<td class="pr-4 py-2">
<td class="pr-4 py-1">
{formatAmount(finalAmount || 0)}
<span class="ml-0.5 opacity-50">
{formatUnit(unit, finalAmount || 0)}
</span>
</td>
<td class="px-4 py-2">{name}</td>
<td class="px-4 py-1">{name}</td>
</tr>
);
};
@@ -66,14 +66,10 @@ export const IngredientsList: FunctionalComponent<
return (
<table class="w-full border-collapse table-auto">
<tbody>
{ingredients.filter((s) => !!s?.length).map((item) => {
{ingredients.map((item) => {
return (
<div dangerouslySetInnerHTML={{ __html: renderMarkdown(item) }}>
</div>
<Ingredient ingredient={item} amount={amount} portion={portion} />
);
// return (
// <Ingredient ingredient={item} amount={amount} portion={portion} />
// );
})}
</tbody>
</table>

View File

@@ -69,7 +69,6 @@ export const SearchResultItem = (
) => {
const resourceType = resources[item?.content._type];
const href = item?.path.replace("/resources", "").replace(/\.md$/, "");
console.log({ item, href });
return (
<a
href={href}