base page title
This commit is contained in:
@@ -3,6 +3,7 @@ import { useGetDashboard, useGetOrderChart } from './hooks/useDashboardData'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import PageLoading from '../../components/PageLoading'
|
||||
import Error from '../../components/Error'
|
||||
import PageTitle from '../../components/PageTitle'
|
||||
import DashboardOverview from './components/DashboardOverview'
|
||||
import ProductsCountSection from './components/ProductsCountSection'
|
||||
import OrdersCountSection from './components/OrdersCountSection'
|
||||
@@ -34,15 +35,15 @@ const Dashboard: FC = () => {
|
||||
const renderDashboardContent = () => {
|
||||
const path = location.pathname
|
||||
|
||||
if (path.includes('products-count')) {
|
||||
if (path.includes('product-stats')) {
|
||||
return <ProductsCountSection data={data?.results} />
|
||||
} else if (path.includes('orders-count')) {
|
||||
} else if (path.includes('order-stats')) {
|
||||
return <OrdersCountSection data={data?.results} />
|
||||
} else if (path.includes('unread-comments')) {
|
||||
return <UnreadCommentsSection data={data?.results} />
|
||||
} else if (path.includes('users-count')) {
|
||||
} else if (path.includes('user-stats')) {
|
||||
return <UsersCountSection data={data?.results} />
|
||||
} else if (path.includes('orders-chart')) {
|
||||
} else if (path.includes('order-chart')) {
|
||||
return <OrdersChartSection
|
||||
dashboardData={data?.results}
|
||||
orderChartData={orderChartData?.results}
|
||||
@@ -55,6 +56,7 @@ const Dashboard: FC = () => {
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<PageTitle />
|
||||
{renderDashboardContent()}
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user