ingredient step sorting dialog and headline option on desktop

This commit is contained in:
vabene1111
2025-01-18 14:32:20 +01:00
parent d294341926
commit efa9e8aa3b
34 changed files with 219 additions and 10 deletions

View File

@@ -0,0 +1,22 @@
import {Ingredient} from "@/openapi";
/**
* returns a string representing an ingredient
* @param ingredient
*/
export function ingredientToString(ingredient: Ingredient) {
let content = []
if(ingredient.amount != 0){
content.push(ingredient.amount)
}
if(ingredient.unit){
content.push(ingredient.unit.name)
}
if(ingredient.food){
content.push(ingredient.food.name)
}
if(ingredient.note){
content.push(`(${ingredient.note})`)
}
return content.join(' ')
}