35 lines
799 B
Vue
35 lines
799 B
Vue
<script lang="ts" setup>
|
|
|
|
import ChatButton from "~/components/product/ChatBox/ChatButton.vue";
|
|
import useGetProduct from "~/composables/api/product/useGetProduct";
|
|
|
|
const route = useRoute();
|
|
|
|
const id = route.params.id as string | undefined;
|
|
|
|
const { suspense } = useGetProduct(id);
|
|
|
|
onServerPrefetch(async () => {
|
|
const response = await suspense();
|
|
|
|
if (response.isError) {
|
|
throw createError({
|
|
statusCode: 404,
|
|
statusMessage: `error : ${response.error.message}`,
|
|
})
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div class="w-full flex flex-col">
|
|
<ProductHero />
|
|
<ProductVideo />
|
|
<ProductComments />
|
|
<ProductDetails />
|
|
<ProductsSlider title="محصولات مشابه" />
|
|
<ChatButton />
|
|
</div>
|
|
</template>
|