buy service and discount and text + ...

This commit is contained in:
hamid zarghami
2025-02-18 16:04:47 +03:30
parent 15aa2ee074
commit ce92067c89
11 changed files with 227 additions and 159 deletions
+41 -112
View File
@@ -1,16 +1,19 @@
import { FC } from 'react'
import { FC, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Input from '../../components/Input'
import Select from '../../components/Select'
import ServiceSection from '../../components/ServiceSection'
import StatusCircle from '../../components/StatusCircle'
import BannerImage from '../../assets/images/banner.png'
import { Link } from 'react-router-dom'
import { Pages } from '../../config/Pages'
import { useGetMyServices } from './hooks/useServiceData'
import { MyServicesItem } from './types/ServiecTypes'
const MyServices: FC = () => {
const { t } = useTranslation('global')
const [search, setSearch] = useState<string>('')
const getServices = useGetMyServices(search)
return (
<div className='w-full flex gap-6 mt-4'>
@@ -25,10 +28,11 @@ const MyServices: FC = () => {
variant='search'
placeholder={t('service.search')}
className='bg-white w-full'
onChangeSearchFinal={(value) => setSearch(value)}
/>
</div>
<div>
{/* <div>
<Select
items={[
{ label: t('all'), value: 'all' },
@@ -37,122 +41,47 @@ const MyServices: FC = () => {
]}
className='max-w-[100px]'
/>
</div>
</div> */}
</div>
<div className='flex flex-wrap xl:gap-6 gap-4 items-center mt-8'>
<Link to={Pages.services.detail + '1'} className='flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6'>
<ServiceSection
item={{
author: "داناک",
createDate: "1403-11-23T20:34:16.000Z",
createdAt: "2025-02-12T07:24:31.499Z",
description: "توضیح کوتاه",
icon: "https://dsc.storage.iran.liara.space/images/19216818-b1ce-4339-b238-9e7ac866d6dc1739345063078.png",
id: "53c3f206-d262-4376-ba9b-92d6c1c3d8fa",
isActive: true,
isDanakSuggest: true,
link: "https://google.com",
metaDescription: "<p><br></p><p>asd asd asd</p>",
name: "تست",
serviceLanguage: "fa",
softwareLanguage: "جاوا اسکریپت",
updatedAt: "2025-02-12T07:40:08.939Z",
userCount: 222
}}
/>
<div className='mt-6 flex gap-1 items-center'>
<StatusCircle
color='#00BA4B'
/>
<div className='text-xs text-description'>1 {t('service.active_menu')}</div>
</div>
{
getServices.data?.data?.subscriptions?.map((item: MyServicesItem) => {
return (
<Link key={item.id} to={Pages.services.detail + item.id} className='flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6'>
<ServiceSection
item={{
author: item.plan.service.author,
createDate: item.plan?.service?.createDate,
createdAt: item.createdAt,
description: item.plan?.service?.description,
icon: item.plan?.service.icon,
id: item.plan.service.id,
isActive: item.plan.isActive,
isDanakSuggest: item.plan.service.isDanakSuggest,
link: item.plan.service.link,
metaDescription: item.plan.service.metaDescription,
name: item.plan.service.name,
serviceLanguage: item.plan.service.serviceLanguage,
softwareLanguage: item.plan.service.softwareLanguage,
updatedAt: item.plan.service.updatedAt,
userCount: item.plan.service?.userCount
}}
/>
<div className='mt-6 flex gap-1 items-center'>
<StatusCircle
color='#00BA4B'
/>
<div className='text-xs text-description'>1 {t('service.active_menu')}</div>
</div>
</Link>
<Link to={Pages.services.detail + '1'} className='flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6'>
<ServiceSection
item={{
author: "داناک",
createDate: "1403-11-23T20:34:16.000Z",
createdAt: "2025-02-12T07:24:31.499Z",
description: "توضیح کوتاه",
icon: "https://dsc.storage.iran.liara.space/images/19216818-b1ce-4339-b238-9e7ac866d6dc1739345063078.png",
id: "53c3f206-d262-4376-ba9b-92d6c1c3d8fa",
isActive: true,
isDanakSuggest: true,
link: "https://google.com",
metaDescription: "<p><br></p><p>asd asd asd</p>",
name: "تست",
serviceLanguage: "fa",
softwareLanguage: "جاوا اسکریپت",
updatedAt: "2025-02-12T07:40:08.939Z",
userCount: 222
}}
/>
<div className='mt-6 flex gap-1 items-center'>
<StatusCircle
color='#00BA4B'
/>
<div className='text-xs text-description'>1 {t('service.active_menu')}</div>
</div>
</Link>
<Link to={Pages.services.detail + '1'} className='flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6'>
<ServiceSection
item={{
author: "داناک",
createDate: "1403-11-23T20:34:16.000Z",
createdAt: "2025-02-12T07:24:31.499Z",
description: "توضیح کوتاه",
icon: "https://dsc.storage.iran.liara.space/images/19216818-b1ce-4339-b238-9e7ac866d6dc1739345063078.png",
id: "53c3f206-d262-4376-ba9b-92d6c1c3d8fa",
isActive: true,
isDanakSuggest: true,
link: "https://google.com",
metaDescription: "<p><br></p><p>asd asd asd</p>",
name: "تست",
serviceLanguage: "fa",
softwareLanguage: "جاوا اسکریپت",
updatedAt: "2025-02-12T07:40:08.939Z",
userCount: 222
}}
/>
<div className='mt-6 flex gap-1 items-center'>
<StatusCircle
color='#00BA4B'
/>
<div className='text-xs text-description'>1 {t('service.active_menu')}</div>
</div>
</Link>
</Link>
)
})
}
<Link to={Pages.services.detail + '1'} className='flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6'>
<ServiceSection
item={{
author: "داناک",
createDate: "1403-11-23T20:34:16.000Z",
createdAt: "2025-02-12T07:24:31.499Z",
description: "توضیح کوتاه",
icon: "https://dsc.storage.iran.liara.space/images/19216818-b1ce-4339-b238-9e7ac866d6dc1739345063078.png",
id: "53c3f206-d262-4376-ba9b-92d6c1c3d8fa",
isActive: true,
isDanakSuggest: true,
link: "https://google.com",
metaDescription: "<p><br></p><p>asd asd asd</p>",
name: "تست",
serviceLanguage: "fa",
softwareLanguage: "جاوا اسکریپت",
updatedAt: "2025-02-12T07:40:08.939Z",
userCount: 222
}}
/>
<div className='mt-6 flex gap-1 items-center'>
<StatusCircle
color='#00BA4B'
/>
<div className='text-xs text-description'>1 {t('service.active_menu')}</div>
</div>
</Link>
</div>
</div>
<div className='bg-white w-sidebar hidden xl:block rounded-3xl overflow-hidden relative'>