fix: analytic view
This commit is contained in:
@@ -5,27 +5,16 @@ import Grid from '@mui/material/Grid2'
|
||||
|
||||
// Component Imports
|
||||
import DistributedBarChartOrder from '@views/dashboards/crm/DistributedBarChartOrder'
|
||||
import EarningReportsWithTabs from '@views/dashboards/crm/EarningReportsWithTabs'
|
||||
|
||||
// Server Action Imports
|
||||
import Loading from '../../../../../../components/layout/shared/Loading'
|
||||
import { usePaymentAnalytics } from '../../../../../../services/queries/analytics'
|
||||
import { PaymentDataItem } from '../../../../../../types/services/analytic'
|
||||
import PaymentMethodReport from '../../../../../../views/dashboards/payment-methods/PaymentMethodReport'
|
||||
|
||||
const DashboardPayment = () => {
|
||||
const { data, isLoading } = usePaymentAnalytics()
|
||||
|
||||
const transformSalesData = (data: PaymentDataItem[]) => {
|
||||
return [
|
||||
{
|
||||
type: 'payment',
|
||||
avatarIcon: 'tabler-package',
|
||||
date: data.map((d: PaymentDataItem) => d.payment_method_name),
|
||||
series: [{ data: data.map((d: PaymentDataItem) => d.total_amount) }]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (isLoading) return <Loading />
|
||||
|
||||
return (
|
||||
@@ -71,26 +60,8 @@ const DashboardPayment = () => {
|
||||
/>
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, lg: 12 }}>
|
||||
<EarningReportsWithTabs data={transformSalesData(data!.data)} />
|
||||
<PaymentMethodReport payments={data?.data as PaymentDataItem[]} />
|
||||
</Grid>
|
||||
{/* <Grid size={{ xs: 12, md: 6, lg: 4 }}>
|
||||
<RadarSalesChart />
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, md: 6, lg: 4 }}>
|
||||
<SalesByCountries />
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, md: 6, lg: 4 }}>
|
||||
<ProjectStatus />
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, md: 6, lg: 4 }}>
|
||||
<ActiveProjects />
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, md: 6 }}>
|
||||
<LastTransaction />
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, md: 6 }}>
|
||||
<ActivityTimeline />
|
||||
</Grid> */}
|
||||
</Grid>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user