1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-04 21:15:22 +02:00
mealie/frontend/components/Domain/Recipe/RecipeSettingsSwitches.vue
Michael Genson 245ca5fe3b
feat: Remove "Is Food" and "Disable Amounts" Flags (#5684)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
2025-07-31 17:36:24 +02:00

38 lines
1,000 B
Vue

<template>
<div>
<v-switch
v-for="(_, key) in model"
:key="key"
v-model="model[key]"
color="primary"
xs
density="compact"
:disabled="key == 'locked' && !isOwner"
class="my-1"
:label="labels[key]"
hide-details
/>
</div>
</template>
<script lang="ts" setup>
import { defineModel, defineProps } from "vue";
import type { RecipeSettings } from "~/lib/api/types/recipe";
import { useI18n } from "#imports";
defineProps<{ isOwner?: boolean }>();
const model = defineModel<RecipeSettings>({ required: true });
const i18n = useI18n();
const labels: Record<keyof RecipeSettings, string> = {
public: i18n.t("recipe.public-recipe"),
showNutrition: i18n.t("recipe.show-nutrition-values"),
showAssets: i18n.t("asset.show-assets"),
landscapeView: i18n.t("recipe.landscape-view-coming-soon"),
disableComments: i18n.t("recipe.disable-comments"),
locked: i18n.t("recipe.locked"),
};
</script>
<style lang="scss" scoped></style>