move the recipe list's toolbar to a component of its own

This commit is contained in:
Anika Raemer 2025-09-20 17:00:27 +02:00
parent 635bec7f64
commit 73b805546f
3 changed files with 42 additions and 21 deletions

View file

@ -94,7 +94,7 @@ export default function RecipeEditor({ recipe, onSave, onCancel }: RecipeEditorP
placeholder="1"
value={draft.servings.amount}
onChange={e => {
let tempServings = draft.servings
const tempServings = draft.servings
tempServings.amount = Number(e.target.value)
setDraft({...draft, servings: tempServings})
}}
@ -104,7 +104,7 @@ export default function RecipeEditor({ recipe, onSave, onCancel }: RecipeEditorP
placeholder="Persons"
value={draft.servings.unit}
onChange={e => {
let tempServings = draft.servings
const tempServings = draft.servings
tempServings.unit = e.target.value
setDraft({...draft, servings: tempServings})
}}