Release Drafter / auto_label (push) Skipped
Release Drafter / draft_release (push) Canceled after 0s
CodeQL / Analyze (javascript-typescript) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
Backend Lint and Test / tests (sqlite) (push) Canceled after 0s
Backend Lint and Test / tests (postgres) (push) Canceled after 0s
Docker Nightly Production / Backend Server Tests (push) Canceled after 0s
Frontend Lint and Test / lint (push) Canceled after 0s
Docker Nightly Production / Frontend Tests (push) Canceled after 0s
Build Package / Build frontend and wheel (push) Canceled after 0s
Docker Nightly Production / Build Package (push) Canceled after 0s
Docker Nightly Production / Build E2E Image Cache (push) Canceled after 0s
Docker Nightly Production / Build Tagged Release (push) Canceled after 0s
Docker Nightly Production / Notify Discord (push) Canceled after 0s
41 lines
2.0 KiB
Vue
41 lines
2.0 KiB
Vue
<template>
|
||
<div v-for="(reference, index) in references ?? []" :key="reference.allocationId ?? index" class="text-body-2">
|
||
<template v-if="reference.quantityKind || reference.weighing || reference.destination || reference.role || reference.sourceText || reference.approximate || reference.containerCount != null || reference.quantityMinimum != null || reference.quantityMaximum != null">
|
||
{{ ingredientName(reference.referenceId) }}:
|
||
{{ $t(`recipe.allocation-${allocationKind(reference)}`) }}
|
||
<template v-if="reference.weighing && reference.weighing !== 'unspecified'">
|
||
· {{ $t(`recipe.weighing-${reference.weighing}`) }}
|
||
</template>
|
||
<template v-if="reference.role">
|
||
· {{ reference.role }}
|
||
</template>
|
||
<template v-if="reference.destination">
|
||
· {{ reference.destination }}
|
||
</template>
|
||
<template v-if="reference.approximate">
|
||
· {{ $t("recipe.allocation-approximate") }}
|
||
</template>
|
||
<template v-if="reference.quantityMinimum != null || reference.quantityMaximum != null">
|
||
· {{ reference.quantityMinimum == null ? "?" : reference.quantityMinimum * scale }}–{{ reference.quantityMaximum == null ? "?" : reference.quantityMaximum * scale }}
|
||
</template>
|
||
<template v-if="reference.containerCount != null">
|
||
· ×{{ reference.containerCount }}
|
||
</template>
|
||
<template v-if="reference.sourceText">
|
||
· {{ reference.sourceText }}
|
||
</template>
|
||
</template>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import type { IngredientReferences, RecipeIngredient } from "~/lib/api/types/recipe";
|
||
import { allocationKind } from "~/lib/recipe/step-ingredients";
|
||
|
||
const props = withDefaults(defineProps<{ references?: IngredientReferences[]; ingredients: RecipeIngredient[]; scale?: number }>(), { scale: 1 });
|
||
function ingredientName(referenceId?: string | null) {
|
||
const ingredient = props.ingredients.find(item => item.referenceId === referenceId);
|
||
return ingredient?.food?.name || ingredient?.note || "";
|
||
}
|
||
</script>
|