feat: manual nutrition entry on recipe editor
Lets authors enter nutrition values by hand instead of relying only on the AI estimate; the detail-page panel now shows whether data was manually entered or AI-estimated and offers to switch between them. v0.35.0
This commit is contained in:
@@ -61,6 +61,11 @@ export default async function EditRecipePage({ params }: Params) {
|
||||
preview: getPublicUrl(photo.storageKey),
|
||||
})),
|
||||
isBatchCook: recipe.isBatchCook,
|
||||
// Only pre-fill the manual-nutrition editor with existing values when
|
||||
// they were actually manually entered — AI-estimated data shouldn't
|
||||
// silently become "manual" just because the recipe happened to have
|
||||
// an estimate on file when it was opened for editing.
|
||||
nutrition: recipe.nutritionManual ? recipe.nutritionData?.perServing ?? null : null,
|
||||
dishes: recipe.batchDishes.map((dish) => ({
|
||||
id: dish.id,
|
||||
name: dish.name,
|
||||
|
||||
Reference in New Issue
Block a user