redirect url + accordion + blog + ...
This commit is contained in:
@@ -110,40 +110,47 @@ const DetailService: FC<{ id: string }> = ({ id }) => {
|
||||
</div>
|
||||
|
||||
{
|
||||
getDetailService.data?.data.danakService?.reviews?.map((item: ReviewItem) => {
|
||||
return (
|
||||
<div key={item.id} className='mt-5 border border-border rounded-3xl p-6'>
|
||||
<div className='flex gap-2 items-center'>
|
||||
<Image alt='avatar' width={24} height={24} src={item.user?.profilePic || defaultAvatar} className='size-6 rounded-full object-cover' />
|
||||
<div className='text-description text-xs'>
|
||||
{item.user?.firstName + ' ' + item.user?.lastName}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='mt-4 flex justify-between'>
|
||||
<div className='text-sm max-w-[70%] truncate'>
|
||||
{item.title}
|
||||
</div>
|
||||
<div className='text-xs text-description'>
|
||||
{moment(item.createdAt).fromNow()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='mt-2'>
|
||||
<Rate
|
||||
disabled
|
||||
value={item.rating}
|
||||
count={5}
|
||||
style={{ fontSize: 14 }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='mt-4 text-[11px] leading-6'>
|
||||
{item.comment}
|
||||
</div>
|
||||
getDetailService.data?.data.danakService?.reviews?.length === 0 ?
|
||||
<div className='flex justify-center items-center h-full mt-7'>
|
||||
<div className='text-description text-sm'>
|
||||
هیچ نظری ثبت نشده است
|
||||
</div>
|
||||
)
|
||||
})
|
||||
</div>
|
||||
:
|
||||
getDetailService.data?.data.danakService?.reviews?.map((item: ReviewItem) => {
|
||||
return (
|
||||
<div key={item.id} className='mt-5 border border-border rounded-3xl p-6'>
|
||||
<div className='flex gap-2 items-center'>
|
||||
<Image alt='avatar' width={24} height={24} src={item.user?.profilePic || defaultAvatar} className='size-6 rounded-full object-cover' />
|
||||
<div className='text-description text-xs'>
|
||||
{item.user?.firstName + ' ' + item.user?.lastName}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='mt-4 flex justify-between'>
|
||||
<div className='text-sm max-w-[70%] truncate'>
|
||||
{item.title}
|
||||
</div>
|
||||
<div className='text-xs text-description'>
|
||||
{moment(item.createdAt).fromNow()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='mt-2'>
|
||||
<Rate
|
||||
disabled
|
||||
value={item.rating}
|
||||
count={5}
|
||||
style={{ fontSize: 14 }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='mt-4 text-[11px] leading-6'>
|
||||
{item.comment}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@ import Link from 'next/link'
|
||||
import { DanakService } from '../types/ProductTypes'
|
||||
import RadioGroup from '@/components/RadioGroup'
|
||||
import Image from 'next/image'
|
||||
|
||||
import { CONSOLE_URL } from '@/config/const'
|
||||
type Props = {
|
||||
data: DanakService,
|
||||
}
|
||||
@@ -25,8 +25,8 @@ const ServiceHeader: FC<Props> = (props: Props) => {
|
||||
|
||||
const plan: any = data?.subscriptionPlans.find((item) => item.id === planSelected)
|
||||
|
||||
setFinalPrice(plan.finalPrice)
|
||||
setPrice(plan?.price)
|
||||
setFinalPrice(plan.price)
|
||||
setPrice(plan?.originalPrice)
|
||||
|
||||
}, [data?.subscriptionPlans, planSelected])
|
||||
|
||||
@@ -82,11 +82,11 @@ const ServiceHeader: FC<Props> = (props: Props) => {
|
||||
{NumberFormat(Number(price))}
|
||||
</div>
|
||||
}
|
||||
<div>{NumberFormat(Number(price))}</div>
|
||||
<div>{NumberFormat(Number(finalPrice))}</div>
|
||||
</div>
|
||||
<span>تومان</span>
|
||||
</div>
|
||||
<Link target='_blank' href={`https://console.danakcorp.com/services/detail/${data?.id}`}>
|
||||
<Link target='_blank' href={`${CONSOLE_URL}/other-service/buy/${data?.id}/${planSelected}`}>
|
||||
<Button
|
||||
// onClick={handleBuy}
|
||||
// isLoading={buyService.isPending}
|
||||
|
||||
Reference in New Issue
Block a user