Ingredient List Item

This commit is contained in:
Kuchenpirat 2025-07-30 11:40:45 +00:00
commit f2ffa154c6

View file

@ -28,34 +28,22 @@
</div> </div>
</template> </template>
<script lang="ts"> <script setup lang="ts">
import type { RecipeIngredient } from "~/lib/api/types/household"; import type { RecipeIngredient } from "~/lib/api/types/household";
import { useParsedIngredientText } from "~/composables/recipes"; import { useParsedIngredientText } from "~/composables/recipes";
export default defineNuxtComponent({ interface Props {
props: { ingredient: RecipeIngredient;
ingredient: { disableAmount?: boolean;
type: Object as () => RecipeIngredient, scale?: number;
required: true, }
}, const props = withDefaults(defineProps<Props>(), {
disableAmount: { disableAmount: false,
type: Boolean, scale: 1,
default: false,
},
scale: {
type: Number,
default: 1,
},
},
setup(props) {
const parsedIng = computed(() => {
return useParsedIngredientText(props.ingredient, props.disableAmount, props.scale);
}); });
return { const parsedIng = computed(() => {
parsedIng, return useParsedIngredientText(props.ingredient, props.disableAmount, props.scale);
};
},
}); });
</script> </script>