fix: button showProduct

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

View File

@@ -3,7 +3,8 @@
<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 v-if="!isShowProductView" class="flex items-end justify-between">
<div class="flex items-center gap-3" v-if="!isTranslations"> <div class="flex items-center gap-3" v-if="!isTranslations">
<p class="text-red-500 text-md whitespace-nowrap">Translate from Polish to</p> <p class="text-red-500 text-md whitespace-nowrap">Translate from Polish to</p>
<USelect v-model="toLangId" :items="availableLangs" value-key="id" label-key="name" <USelect v-model="toLangId" :items="availableLangs" value-key="id" label-key="name"
@@ -19,6 +20,34 @@
</template> </template>
</USelect> </USelect>
</div> </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 v-else> <div v-else>
<UButton @click="isShowProductView = false" color="primary" <UButton @click="isShowProductView = false" color="primary"
class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!"> class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!">