my ccompany + footer+ nofit + ...
This commit is contained in:
@@ -2,22 +2,18 @@ import { FC, useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { useApplyDiscount, useGetInvoiceDetail, useRemoveDiscount } from './hooks/useReceiptData'
|
||||
import { ApplyDiscountType, ReceiptDetailItemType } from './types/ReceiptTypes'
|
||||
import { ApplyDiscountType, GatewayItemType, ReceiptDetailItemType } from './types/ReceiptTypes'
|
||||
import { NumberFormat } from '../../config/func'
|
||||
import moment from 'moment-jalaali'
|
||||
import LegalInfo from './components/LegalInfo'
|
||||
import RealInfo from './components/RealInfo'
|
||||
import RegisterInfo from './components/RegisterInfo'
|
||||
import { clx } from '../../helpers/utils'
|
||||
import Button from '../../components/Button'
|
||||
import ApproveInvoice from './components/ApproveInvoice'
|
||||
import PayInvoice from './components/PayInvoice'
|
||||
import Input from '../../components/Input'
|
||||
import { useGetProfile } from '../profile/hooks/useProfileData'
|
||||
import { toast } from 'react-toastify'
|
||||
import { ErrorType } from '../../helpers/types'
|
||||
// import PDFGenerator from '../../components/PDFGenerator'
|
||||
// import { useGetGetWays } from '../wallet/hooks/useWalletData'
|
||||
import { useGetGetWays } from './hooks/useReceiptData'
|
||||
// import { GatewayItemType } from '../wallet/types/WalletTypes'
|
||||
|
||||
const ReceiptsDetail: FC = () => {
|
||||
@@ -26,11 +22,10 @@ const ReceiptsDetail: FC = () => {
|
||||
const { t } = useTranslation('global')
|
||||
const [code, setCode] = useState<string>('')
|
||||
const [gateWayId, setGateWayId] = useState<string>('')
|
||||
const getProfile = useGetProfile()
|
||||
const getInvoce = useGetInvoiceDetail(id ? id : '')
|
||||
const applyDiscount = useApplyDiscount()
|
||||
const removeDiscount = useRemoveDiscount()
|
||||
// const getWays = useGetGetWays()
|
||||
const getWays = useGetGetWays()
|
||||
|
||||
const handleApplyDiscount = () => {
|
||||
const params: ApplyDiscountType = {
|
||||
@@ -60,13 +55,13 @@ const ReceiptsDetail: FC = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// useEffect(() => {
|
||||
useEffect(() => {
|
||||
|
||||
// if (getWays.data) {
|
||||
// setGateWayId(getWays.data?.data?.paymentGateways?.[0]?.id)
|
||||
// }
|
||||
if (getWays.data) {
|
||||
setGateWayId(getWays.data?.data?.paymentGateways?.[0]?.id)
|
||||
}
|
||||
|
||||
// }, [getWays.data])
|
||||
}, [getWays.data])
|
||||
|
||||
|
||||
return (
|
||||
@@ -299,26 +294,23 @@ const ReceiptsDetail: FC = () => {
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
{/* {
|
||||
getInvoce.data?.data?.remainingToCharge > 0 &&
|
||||
<div className='flex mt-6 justify-center gap-2'>
|
||||
{
|
||||
getWays.data?.data?.paymentGateways?.map((item: GatewayItemType) => {
|
||||
return (
|
||||
<div key={item.id} className={clx(
|
||||
'size-[72px] rounded-xl border border-border flex flex-col justify-center items-center',
|
||||
gateWayId === item.id && 'border-black'
|
||||
)}>
|
||||
<img src={item.logoUrl} className='w-8' />
|
||||
<div className='mt-1 text-[10px]'>
|
||||
{item.name}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
} */}
|
||||
<div className='flex mt-6 justify-center gap-2'>
|
||||
{
|
||||
getWays.data?.data?.paymentGateways?.map((item: GatewayItemType) => {
|
||||
return (
|
||||
<div key={item.id} className={clx(
|
||||
'size-[72px] rounded-xl border border-border flex flex-col justify-center items-center',
|
||||
gateWayId === item.id && 'border-black'
|
||||
)}>
|
||||
<img src={item.logoUrl} className='w-8' />
|
||||
<div className='mt-1 text-[10px]'>
|
||||
{item.name}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user