fix: button showProduct

This commit is contained in:
2026-04-02 09:01:26 +02:00
parent 9c8ce43998
commit 7e8e9897e1

View File

@@ -3,21 +3,50 @@
<p class="cursor-pointer" @click="backFromProduct()">Back to products</p> <p class="cursor-pointer" @click="backFromProduct()">Back to products</p>
<div class="container my-10 mx-auto "> <div class="container my-10 mx-auto ">
<div <div
class="flex items-end justify-between gap-4 mb-6 bg-(--second-light) dark:bg-(--main-dark) border border-(--border-light) dark:border-(--border-dark) p-4 rounded-md"> class=" gap-4 mb-6 bg-(--second-light) dark:bg-(--main-dark) border border-(--border-light) dark:border-(--border-dark) p-4 rounded-md">
<div class="flex items-center gap-3" v-if="!isTranslations"> <div v-if="!isShowProductView" class="flex items-end justify-between">
<p class="text-red-500 text-md whitespace-nowrap">Translate from Polish to</p> <div class="flex items-center gap-3" v-if="!isTranslations">
<USelect v-model="toLangId" :items="availableLangs" value-key="id" label-key="name" <p class="text-red-500 text-md whitespace-nowrap">Translate from Polish to</p>
placeholder="Select language" class="w-48"> <USelect v-model="toLangId" :items="availableLangs" value-key="id" label-key="name"
<template #selected="{ modelValue }"> placeholder="Select language" class="w-48">
{{ modelValue }} <template #selected="{ modelValue }">
</template> {{ modelValue }}
<template #item-label="{ item }"> </template>
<div class="flex items-center gap-2"> <template #item-label="{ item }">
<span>{{ item.flag }}</span> <div class="flex items-center gap-2">
<span>{{ item.name }}</span> <span>{{ item.flag }}</span>
</div> <span>{{ item.name }}</span>
</template> </div>
</USelect> </template>
</USelect>
</div>
<div class="flex gap-3 items-end justify-end">
<UButton @click="() => {
fetchForLanguage(toLangId)
isShowProductView = true
}" color="primary" v-if="isTranslations === false"
class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!">
Show product
</UButton>
<UButton @click="translateToSelectedLanguage" color="primary" :loading="translating"
v-if="isTranslations === false"
class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!">
Translate
</UButton>
<div v-else class="flex gap-3 items-end justify-end">
<UButton @click="() => {
toLangId = settingStore.shopDefaultLanguage
isTranslations = false
}" color="primary" class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!">
Cancel
</UButton>
<UButton color="primary" @click="saveDescription"
class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!">
Save
</UButton>
</div>
</div>
</div> </div>
<div v-else> <div v-else>
<UButton @click="isShowProductView = false" color="primary" <UButton @click="isShowProductView = false" color="primary"