remove address from restaurant list
This commit is contained in:
@@ -5,7 +5,7 @@ import PageLoading from '../../../components/PageLoading'
|
|||||||
import Td from '../../../components/Td'
|
import Td from '../../../components/Td'
|
||||||
import { RestaurantType, RestaurantsResponse } from '../types/Types'
|
import { RestaurantType, RestaurantsResponse } from '../types/Types'
|
||||||
import moment from 'moment-jalaali'
|
import moment from 'moment-jalaali'
|
||||||
import { Copy, Edit } from 'iconsax-react'
|
import { Edit } from 'iconsax-react'
|
||||||
import { toast } from 'react-toastify'
|
import { toast } from 'react-toastify'
|
||||||
import Button from '../../../components/Button'
|
import Button from '../../../components/Button'
|
||||||
import RestaurantAdminsModal from './components/RestaurantAdminsModal'
|
import RestaurantAdminsModal from './components/RestaurantAdminsModal'
|
||||||
@@ -39,17 +39,6 @@ const RestaurantsList: FC = () => {
|
|||||||
setSelectedRestaurantId('')
|
setSelectedRestaurantId('')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCopyAddress = async (address: string | null) => {
|
|
||||||
if (!address) return
|
|
||||||
|
|
||||||
try {
|
|
||||||
await navigator.clipboard.writeText(address)
|
|
||||||
toast.success('کپی شد')
|
|
||||||
} catch {
|
|
||||||
toast.error('خطا در کپی کردن')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const calculateDaysRemaining = (endDate: string): string => {
|
const calculateDaysRemaining = (endDate: string): string => {
|
||||||
const end = moment(endDate)
|
const end = moment(endDate)
|
||||||
const now = moment()
|
const now = moment()
|
||||||
@@ -94,7 +83,6 @@ const RestaurantsList: FC = () => {
|
|||||||
<tr>
|
<tr>
|
||||||
<Td text={t('restaurant.name')} />
|
<Td text={t('restaurant.name')} />
|
||||||
<Td text={t('restaurant.phone')} />
|
<Td text={t('restaurant.phone')} />
|
||||||
<Td text={t('restaurant.address')} />
|
|
||||||
<Td text={t('restaurant.slug')} />
|
<Td text={t('restaurant.slug')} />
|
||||||
<Td text={t('restaurant.plan')} />
|
<Td text={t('restaurant.plan')} />
|
||||||
<Td text={t('restaurant.status')} />
|
<Td text={t('restaurant.status')} />
|
||||||
@@ -111,19 +99,6 @@ const RestaurantsList: FC = () => {
|
|||||||
<tr key={item.id} className='tr'>
|
<tr key={item.id} className='tr'>
|
||||||
<Td text={item.name} />
|
<Td text={item.name} />
|
||||||
<Td text={item.phone || '-'} />
|
<Td text={item.phone || '-'} />
|
||||||
<Td text={''}>
|
|
||||||
<div className='flex items-center gap-2'>
|
|
||||||
<span>{item.address || '-'}</span>
|
|
||||||
{item.address && (
|
|
||||||
<Copy
|
|
||||||
size={18}
|
|
||||||
color='#8C90A3'
|
|
||||||
className='cursor-pointer hover:text-primary transition-colors'
|
|
||||||
onClick={() => handleCopyAddress(item.address)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Td>
|
|
||||||
<Td text={item?.slug || '-'} />
|
<Td text={item?.slug || '-'} />
|
||||||
<Td text={item.plan || '-'} />
|
<Td text={item.plan || '-'} />
|
||||||
<Td text={''}>
|
<Td text={''}>
|
||||||
|
|||||||
Reference in New Issue
Block a user