114 lines
2.4 KiB
Vue
114 lines
2.4 KiB
Vue
<script setup lang="ts">
|
|
import {useLabelEditorStore} from "~/store/labelEditorStore";
|
|
import type {Ref} from "vue";
|
|
import DeleteConfirm from "~/components/ui/deleteConfirm.vue";
|
|
import type {Nutrition} from "~/types/nutrition.ts";
|
|
|
|
const props = defineProps({
|
|
nutrition: {type: Object as PropType<Nutrition | null>, required: true},
|
|
});
|
|
|
|
let store = useLabelEditorStore();
|
|
let loading: Ref<boolean> = ref<boolean>(false);
|
|
let dialog: Ref<boolean> = ref<boolean>(false);
|
|
|
|
async function updateNutrition() {
|
|
|
|
}
|
|
|
|
async function deleteNutrition() {
|
|
|
|
closeDialog();
|
|
}
|
|
|
|
function closeDialog() {
|
|
dialog.value = false;
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<v-dialog
|
|
v-model="dialog"
|
|
:scrollable="true"
|
|
width="800"
|
|
max-height="750"
|
|
height="750"
|
|
>
|
|
<template v-slot:activator="{ props }">
|
|
<v-btn
|
|
:flat="true"
|
|
v-bind="props"
|
|
size="small"
|
|
>
|
|
<v-icon v-if="nutrition != null" color="success">mdi-nutrition</v-icon>
|
|
<v-icon v-else>mdi-nutrition</v-icon>
|
|
|
|
<v-tooltip v-if="nutrition != null"
|
|
activator="parent"
|
|
location="bottom"
|
|
>
|
|
Nährwerte
|
|
</v-tooltip>
|
|
|
|
<v-tooltip v-else
|
|
activator="parent"
|
|
location="bottom"
|
|
>
|
|
Nährwerte hinzufügen
|
|
</v-tooltip>
|
|
</v-btn>
|
|
</template>
|
|
|
|
<v-card>
|
|
<v-card-title>
|
|
<v-row style="padding-top: 10px">
|
|
<v-icon size="small">
|
|
mdi-nutrition
|
|
</v-icon>
|
|
|
|
Nährwerte
|
|
|
|
<v-progress-circular v-if="loading" indeterminate :size="15" :width="2"></v-progress-circular>
|
|
</v-row>
|
|
</v-card-title>
|
|
|
|
<v-divider/>
|
|
|
|
<v-card-text>
|
|
test
|
|
</v-card-text>
|
|
|
|
<v-divider/>
|
|
|
|
<v-card-actions>
|
|
<v-spacer/>
|
|
<DeleteConfirm
|
|
title="Nährwert löschen?"
|
|
:disable="!loading"
|
|
@delete="deleteNutrition()"
|
|
/>
|
|
<v-divider vertical/>
|
|
|
|
<v-btn
|
|
variant="text"
|
|
:disabled="loading"
|
|
@click="closeDialog()"
|
|
>
|
|
Speichern
|
|
</v-btn>
|
|
|
|
<v-btn
|
|
variant="text"
|
|
:disabled="loading"
|
|
@click="closeDialog()"
|
|
>
|
|
Schließen
|
|
</v-btn>
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
</template>
|
|
|
|
<style scoped>
|
|
|
|
</style> |