Newer
Older

Konrad Mohrfeldt
committed
<FormGroup
:label="t('showMeta.logo')"
:errors="logoId.errors"
:is-saving="logoId.isSaving"
custom-control
>
<template #default="attrs">

Konrad Mohrfeldt
committed
<ImagePicker v-model="logoId.value" v-bind="attrs" />
</template>
</FormGroup>

Konrad Mohrfeldt
committed
<FormGroup
:label="t('showMeta.image')"
:errors="imageId.errors"
:is-saving="imageId.isSaving"
custom-control
>
<template #default="attrs">

Konrad Mohrfeldt
committed
<ImagePicker v-model="imageId.value" v-bind="attrs" />
</template>
</FormGroup>
</template>
<script lang="ts" setup>
import { useI18n } from '@/i18n'

Konrad Mohrfeldt
committed
import { useShowStore } from '@/stores'
import { Show } from '@/types'
import ImagePicker from '@/components/images/ImagePicker.vue'
import FormGroup from '@/components/generic/FormGroup.vue'

Konrad Mohrfeldt
committed
import { useAPIObjectFieldCopy } from '@/form'

Konrad Mohrfeldt
committed
const props = defineProps<{
show: Show
}>()
const showStore = useShowStore()
const { t } = useI18n()

Konrad Mohrfeldt
committed
const logoId = useAPIObjectFieldCopy(showStore, () => props.show, 'logoId', { debounce: 0 })
const imageId = useAPIObjectFieldCopy(showStore, () => props.show, 'imageId', { debounce: 0 })