added component for MacroBadge,
used MacroBadge.vue in Day Meal, Meal View and Ingrediens View
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import MacroBadge from '@/components/common/MacroBadge.vue'
|
||||
import type { Meal, MealType } from '@/types/domain'
|
||||
|
||||
const props = defineProps<{
|
||||
@ -40,12 +41,15 @@ const selectedValue = computed({
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</select>
|
||||
<p class="day-meal-card__summary" v-if="meal?.totals">
|
||||
{{ meal.totals.kcal }} {{ t('common.kcalUnit') }}
|
||||
· {{ t('nutrition.short.protein') }} {{ meal.totals.protein_g }} g
|
||||
· {{ t('nutrition.short.carbs') }} {{ meal.totals.carbs_g }} g
|
||||
· {{ t('nutrition.short.fat') }} {{ meal.totals.fat_g }} g
|
||||
</p>
|
||||
<div class="day-meal-card__summary day-meal-card__summary--nutrition" v-if="meal?.totals">
|
||||
<span class="day-meal-card__kcal">{{ meal.totals.kcal }} {{ t('common.kcalUnit') }}</span>
|
||||
<div class="macro-badge-group macro-badge-group--compact">
|
||||
<MacroBadge macro="protein" :label="t('nutrition.short.protein')" :grams="meal.totals.protein_g" />
|
||||
<MacroBadge macro="carbs" :label="t('nutrition.short.carbs')" :grams="meal.totals.carbs_g" />
|
||||
<MacroBadge macro="fat" :label="t('nutrition.short.fat')" :grams="meal.totals.fat_g" />
|
||||
<MacroBadge macro="fiber" :label="t('nutrition.short.fiber')" :grams="meal.totals.fiber_g" />
|
||||
</div>
|
||||
</div>
|
||||
<p class="day-meal-card__summary" v-else>
|
||||
{{ t('today.noItems') }}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user