feat: add some more titles
This commit is contained in:
@ -6,9 +6,9 @@ import type {
|
||||
} from "../lib/recipes.ts";
|
||||
import { FunctionalComponent } from "preact";
|
||||
|
||||
type IngredientsProps = {
|
||||
ingredients: Ingredients;
|
||||
};
|
||||
function numberToString(num: number) {
|
||||
return (Math.floor(num * 4) / 4).toString();
|
||||
}
|
||||
|
||||
const Ingredient = (
|
||||
{ ingredient, amount, key = "", portion = 1 }: {
|
||||
@ -27,7 +27,8 @@ const Ingredient = (
|
||||
return (
|
||||
<tr key={key}>
|
||||
<td class="pr-4 py-2">
|
||||
{finalAmount + (typeof unit === "string" ? unit : "")}
|
||||
{numberToString(finalAmount || 0) +
|
||||
(typeof unit === "string" ? unit : "")}
|
||||
</td>
|
||||
<td class="px-4 py-2">{type}</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user