Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec1402f610 | |||
| 4481dae24e | |||
| 68eb0f9abc | |||
| b5a5452a0d | |||
| 0a66679950 | |||
| fd9eb08cea | |||
| 1e28046093 | |||
| 4b39b73931 | |||
| 54bfe7affa | |||
| d7cfb03550 | |||
| 2324980cf4 | |||
| ebcde80a3d | |||
| 9a0ed2d78c | |||
| 5783dfd521 | |||
| b26df44c19 | |||
| 2a92649eec | |||
| 52193f0baa | |||
| a118adac65 | |||
| de114904d2 | |||
| 82123bf254 | |||
| f70d39ab38 | |||
| 2b1c499cca | |||
| 584225e08b | |||
| f33a945384 | |||
| a08ee7187c | |||
| 403e7df2b8 | |||
| 90390a77b3 |
@@ -2,6 +2,8 @@ const RouteLinks = {
|
|||||||
loginPage: '/auth/login',
|
loginPage: '/auth/login',
|
||||||
homePage: '/',
|
homePage: '/',
|
||||||
customerPage: '/customer',
|
customerPage: '/customer',
|
||||||
|
accountDetails: '/account-view/*',
|
||||||
|
subscriptionDetails: '/subscription-view/*',
|
||||||
subscriptions: '/subscriptions',
|
subscriptions: '/subscriptions',
|
||||||
billings: '/billings',
|
billings: '/billings',
|
||||||
recentSignup: '/recent-signup',
|
recentSignup: '/recent-signup',
|
||||||
@@ -9,6 +11,8 @@ const RouteLinks = {
|
|||||||
transactionsPage: '/transactions',
|
transactionsPage: '/transactions',
|
||||||
products: '/products',
|
products: '/products',
|
||||||
usersAdmin: '/users-admin',
|
usersAdmin: '/users-admin',
|
||||||
|
productTemplates: '/products-template',
|
||||||
|
customTemplates: '/custom-template',
|
||||||
transaction_details_page: '/transaction/details',
|
transaction_details_page: '/transaction/details',
|
||||||
errorPage: '*',
|
errorPage: '*',
|
||||||
}
|
}
|
||||||
|
|||||||
+38
-29
@@ -1,5 +1,5 @@
|
|||||||
import { Suspense } from 'react'
|
import {Suspense} from 'react'
|
||||||
import { Routes, Route } from 'react-router-dom'
|
import {Routes, Route} from 'react-router-dom'
|
||||||
import RouteLinks from './RouteLinks'
|
import RouteLinks from './RouteLinks'
|
||||||
|
|
||||||
import UserExist from './authorization/UserExist'
|
import UserExist from './authorization/UserExist'
|
||||||
@@ -16,39 +16,48 @@ import ProductsPage from './pages/ProductsPage' // PRODUCTS PAGE
|
|||||||
import ErrorPage from './pages/ErrorPage';
|
import ErrorPage from './pages/ErrorPage';
|
||||||
|
|
||||||
import LoansPage from './pages/LoansPage' // SELECTED LOANS PAGE
|
import LoansPage from './pages/LoansPage' // SELECTED LOANS PAGE
|
||||||
import TransactionDetailsPage from './pages/TransactionDetailsPage' // TRANSACTION DETAILS PAGE
|
import TransactionDetailsPage from './pages/TransactionDetailsPage'
|
||||||
|
import AccountDetailsPage from "./pages/AccountDetailsPage";
|
||||||
|
import ProductTemplatePage from "./pages/ProductTemplatePage";
|
||||||
|
import CustomTemplatePage from "./pages/CustomTemplatePage";
|
||||||
|
import SubscriptionDetailsPage from "./pages/SubscriptionDetailsPage"; // TRANSACTION DETAILS PAGE
|
||||||
|
|
||||||
|
|
||||||
// const Home = lazy(() => import('./pages/Home'));
|
// const Home = lazy(() => import('./pages/Home'));
|
||||||
|
|
||||||
export default function SiteRoutes() {
|
export default function SiteRoutes() {
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path={RouteLinks.loginPage} element={<LoginPage />} /> {`*/LOGIN PAGE*/`}
|
<Route path={RouteLinks.loginPage} element={<LoginPage/>}/> {`*/LOGIN PAGE*/`}
|
||||||
|
|
||||||
<Route element={<UserExist />}>
|
<Route element={<UserExist/>}>
|
||||||
<Route path={RouteLinks.homePage} element={<HomePage />} /> {`*/HOME PAGE*/`}
|
<Route path={RouteLinks.homePage} element={<HomePage/>}/> {`*/HOME PAGE*/`}
|
||||||
<Route path={RouteLinks.recentSignup} element={<RecentSignupPage />} /> {`*/RECENT SIGNUP PAGE*/`}
|
<Route path={RouteLinks.recentSignup} element={<RecentSignupPage/>}/> {`*/RECENT SIGNUP PAGE*/`}
|
||||||
<Route path={RouteLinks.subscriptions} element={<SubscriptionsPage />} /> {`*/SUBSCRIPTIONS PAGE*/`}
|
<Route path={RouteLinks.subscriptions} element={<SubscriptionsPage/>}/> {`*/SUBSCRIPTIONS PAGE*/`}
|
||||||
<Route path={RouteLinks.customerPage} element={<CustomerPage />} /> {`*/CUSTOMER PAGE*/`}
|
<Route path={RouteLinks.customerPage} element={<CustomerPage/>}/> {`*/CUSTOMER PAGE*/`}
|
||||||
<Route path={RouteLinks.billings} element={<BillingsPage />} /> {`*/BILLINGS PAGE*/`}
|
<Route path={RouteLinks.accountDetails} element={<AccountDetailsPage/>}/> {`*/CUSTOMER PAGE*/`}
|
||||||
<Route path={RouteLinks.products} element={<ProductsPage />} /> {`*/PRODUCTS PAGE*/`}
|
<Route path={RouteLinks.billings} element={<BillingsPage/>}/> {`*/BILLINGS PAGE*/`}
|
||||||
<Route path={RouteLinks.usersAdmin} element={<UsersAdminPage />} /> {`*/ADMIN USERS PAGE*/`}
|
<Route path={RouteLinks.products} element={<ProductsPage/>}/> {`*/PRODUCTS PAGE*/`}
|
||||||
|
<Route path={RouteLinks.usersAdmin} element={<UsersAdminPage/>}/> {`*/ADMIN USERS PAGE*/`}
|
||||||
|
|
||||||
<Route path={RouteLinks.loansPage} element={<LoansPage />} /> {`*/LOANS PAGE*/`}
|
<Route path={RouteLinks.productTemplates} element={<ProductTemplatePage/>}/> {`*/PRODUCTS TEMPLATE PAGE*/`}
|
||||||
<Route path={RouteLinks.transaction_details_page} element={<TransactionDetailsPage />} /> {`*/TRANSACTION PAGE*/`}
|
<Route path={RouteLinks.customTemplates} element={<CustomTemplatePage/>}/> {`*/CUSTOM TEMPLATES PAGE*/`}
|
||||||
</Route>
|
|
||||||
|
|
||||||
{/* ERROR PAGE */}
|
<Route path={RouteLinks.loansPage} element={<LoansPage/>}/> {`*/LOANS PAGE*/`}
|
||||||
<Route
|
<Route path={RouteLinks.transaction_details_page}
|
||||||
path={RouteLinks.errorPage} // error page
|
element={<TransactionDetailsPage/>}/> {`*/TRANSACTION PAGE*/`}
|
||||||
element={
|
<Route path={RouteLinks.subscriptionDetails} element={<SubscriptionDetailsPage/>} />
|
||||||
<Suspense fallback={<PageLoader />}>
|
</Route>
|
||||||
<ErrorPage />
|
|
||||||
</Suspense>
|
{/* ERROR PAGE */}
|
||||||
}
|
<Route
|
||||||
/>
|
path={RouteLinks.errorPage} // error page
|
||||||
</Routes>
|
element={
|
||||||
)
|
<Suspense fallback={<PageLoader/>}>
|
||||||
|
<ErrorPage/>
|
||||||
|
</Suspense>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Routes>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
export default function AccountProfileView({profile}) {
|
||||||
|
return <>
|
||||||
|
<div className="pb-5">
|
||||||
|
<div className="flex flex-col gap-1">
|
||||||
|
<div className="w-full">
|
||||||
|
<h4 className="font-semibold text-lg">Account Profile</h4>
|
||||||
|
</div>
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<>
|
||||||
|
<table className="py-2 w-full text-sm bg-[aliceblue] dark:bg-transparent rounded-[10px]">
|
||||||
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th scope="col" className="px-2 py-2">
|
||||||
|
Member ID
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Practice/specialization
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
URL Name
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{(profile && Object.keys(profile).length > 0) ?
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{profile?.member_id}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">Practice: {profile?.practice}</div>
|
||||||
|
<div className="text-base font-semibold">Specialization: {profile?.specialization}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{profile?.url_name}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={3}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
import {useEffect, useState} from 'react'
|
||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {useLocation, useNavigate, Link} from 'react-router-dom'
|
||||||
|
|
||||||
|
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||||
|
import RouteLinks from '../../RouteLinks'
|
||||||
|
import { getAccountView } from '../../services/siteServices'
|
||||||
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
import CustomerAccountView from "./CustomerAccountView";
|
||||||
|
import AccountProfileView from "./AccountProfileView";
|
||||||
|
import CustomerSubscriptionsView from "./CustomerSubscriptionsView";
|
||||||
|
import CustomerPaymentsView from "./CustomerPaymentsView";
|
||||||
|
|
||||||
|
export default function AccountViewCom() {
|
||||||
|
|
||||||
|
const {state} = useLocation()
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!state?.memberUID){
|
||||||
|
navigate(RouteLinks.homePage, {replace: true})
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: queryKeys.account_view,
|
||||||
|
queryFn: () => {
|
||||||
|
// const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||||
|
const reqData = {
|
||||||
|
member_uid: state?.memberUID
|
||||||
|
// page,
|
||||||
|
// ...filterData
|
||||||
|
}
|
||||||
|
return getAccountView(reqData)
|
||||||
|
},
|
||||||
|
staleTime: 0 //0 mins
|
||||||
|
})
|
||||||
|
const accountsViewData = data?.data // ACCOUNT VIEW DATA
|
||||||
|
const account_info = accountsViewData?.account
|
||||||
|
const account_profile = accountsViewData?.account_profile
|
||||||
|
const subscriptions = accountsViewData?.subscriptions
|
||||||
|
const payments = accountsViewData?.payments
|
||||||
|
// console.log('DATA', payments, subscriptions)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='w-full flex flex-col gap-8'>
|
||||||
|
<BreadcrumbCom title={`Account View [${state?.memberUID}]`} paths={['Dashboard', 'Account View']}/>
|
||||||
|
|
||||||
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
|
{isFetching ?
|
||||||
|
<>
|
||||||
|
<p className='text-slate-800'>Loading...</p>
|
||||||
|
</>
|
||||||
|
: isError ?
|
||||||
|
<p className='text-red-500'>{error.message}</p>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
<CustomerAccountView accountInfo={account_info} />
|
||||||
|
<AccountProfileView profile={account_profile} />
|
||||||
|
<CustomerSubscriptionsView subscriptions={subscriptions} />
|
||||||
|
<CustomerPaymentsView payments={payments} />
|
||||||
|
</>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import {Link} from 'react-router-dom'
|
||||||
|
import Icons from "../Icons";
|
||||||
|
|
||||||
|
export default function CustomerAccountView({accountInfo}) {
|
||||||
|
return <>
|
||||||
|
<div className="pb-5">
|
||||||
|
<div className="flex flex-col gap-1">
|
||||||
|
<div className="w-full">
|
||||||
|
<h4 className="font-semibold text-lg">Account Info</h4>
|
||||||
|
</div>
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<>
|
||||||
|
<table className="py-2 w-full text-sm bg-[aliceblue] dark:bg-transparent rounded-[10px]">
|
||||||
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th scope="col" className="px-2 py-2">
|
||||||
|
Firstname
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Lastname
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Username
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Email
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th scope="col" className="px-2 text-right">
|
||||||
|
Action
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{(accountInfo && Object.keys(accountInfo).length > 0) ?
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
{/*<td className="px-2 py-2">*/}
|
||||||
|
{/* <div className="text-left">*/}
|
||||||
|
{/* <div className="text-base font-semibold">{1}</div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/*</td>*/}
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{accountInfo?.firstname}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{accountInfo?.lastname}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{accountInfo?.username}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{accountInfo?.email}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td className="px-2 text-right">
|
||||||
|
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
||||||
|
<div
|
||||||
|
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||||
|
<Link
|
||||||
|
// to={`/subscription-view/63554d40-9ba1-4afe-80c2-ca147236f7ee`}
|
||||||
|
>
|
||||||
|
<Icons name='eye'/>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={6}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
|
||||||
|
export default function CustomerPaymentsView({payments}) {
|
||||||
|
return <>
|
||||||
|
<div className="pb-5">
|
||||||
|
<div className="flex flex-col gap-1">
|
||||||
|
<div className="w-full">
|
||||||
|
<h4 className="font-semibold text-lg">Payments</h4>
|
||||||
|
</div>
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<>
|
||||||
|
<table className="py-2 w-full text-sm bg-[aliceblue] dark:bg-transparent rounded-[10px]">
|
||||||
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" className="px-2 py-2">
|
||||||
|
#
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Added
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Option Name
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Amount
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Currency
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{(payments && payments.length > 0) ? payments?.map((item, index) => (
|
||||||
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-2 py-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{index+1}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.added}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.option_name}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.amount}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">Dollars</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={4}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
import getDateTimeFromDateString from "../../helpers/getDateTimeFromDateString";
|
||||||
|
import RouteLinks from "../../RouteLinks";
|
||||||
|
import Icons from "../Icons";
|
||||||
|
import {Link} from 'react-router-dom'
|
||||||
|
|
||||||
|
export default function CustomerSubscriptionsView({subscriptions}) {
|
||||||
|
return <>
|
||||||
|
<div className="pb-5">
|
||||||
|
<div className="flex flex-col gap-1">
|
||||||
|
<div className="w-full">
|
||||||
|
<h4 className="font-semibold text-lg">Subscriptions</h4>
|
||||||
|
</div>
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<>
|
||||||
|
<table className="py-2 w-full text-sm bg-[aliceblue] dark:bg-transparent rounded-[10px]">
|
||||||
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" className="px-2 py-2">
|
||||||
|
#
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Added
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Product
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
URL / Templates
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Status
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2 text-right">
|
||||||
|
Action
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{(subscriptions && subscriptions.length > 0) ? subscriptions?.map((item, index) => (
|
||||||
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-2 py-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{index+1}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.product_id}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.internal_url}
|
||||||
|
<br /><span>Template :</span> {item?.product_template}
|
||||||
|
<br /><span>Custom :</span> {item?.custom_template}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-right">
|
||||||
|
<div className="text-base font-semibold">{item?.status}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2 text-right">
|
||||||
|
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
||||||
|
<div
|
||||||
|
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||||
|
<Link to={`/subscription-view/${item?.subscription_uid}`} state={{customerID: item?.id, subscriptionUID: item?.subscription_uid}}>
|
||||||
|
<Icons name='eye'/>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={6}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
@@ -133,7 +133,8 @@ export default function CustomerCom() {
|
|||||||
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
||||||
<div
|
<div
|
||||||
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||||
<Link to={''} state={{customerID: item?.id}}>
|
<Link to={`/account-view/${item?.member_uid}`}
|
||||||
|
state={{customerID: item?.id, memberUID: item?.member_uid}}>
|
||||||
<Icons name='eye'/>
|
<Icons name='eye'/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+175
-162
@@ -1,13 +1,13 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {Link} from 'react-router-dom'
|
import {Link} from 'react-router-dom'
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import {useQuery} from "@tanstack/react-query";
|
||||||
import BreadcrumbCom from '../../components/breadcrumb/BreadcrumbCom'
|
import BreadcrumbCom from '../../components/breadcrumb/BreadcrumbCom'
|
||||||
import CustomCounter from '../../components/CustomCounter'
|
import CustomCounter from '../../components/CustomCounter'
|
||||||
import Icons from '../../components/Icons'
|
import Icons from '../../components/Icons'
|
||||||
import formatNumber from '../../helpers/formatNumber'
|
import formatNumber from '../../helpers/formatNumber'
|
||||||
|
|
||||||
import queryKeys from '../../services/queryKeys'
|
import queryKeys from '../../services/queryKeys'
|
||||||
import { getDashData } from '../../services/siteServices'
|
import {getDashData} from '../../services/siteServices'
|
||||||
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
||||||
import getTimeFromDateString from '../../helpers/GetTimeFromDateString';
|
import getTimeFromDateString from '../../helpers/GetTimeFromDateString';
|
||||||
import localImgLoader from '../../helpers/localImageLoader';
|
import localImgLoader from '../../helpers/localImageLoader';
|
||||||
@@ -15,176 +15,189 @@ import RouteLinks from '../../RouteLinks';
|
|||||||
|
|
||||||
export default function HomeCom() {
|
export default function HomeCom() {
|
||||||
|
|
||||||
const {data, isFetching, isError, error} = useQuery({
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.dashboard,
|
queryKey: queryKeys.dashboard,
|
||||||
queryFn: () => getDashData(),
|
queryFn: () => getDashData(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const dashData = data?.data // DASHBOARD DATA
|
const dashData = data?.data // DASHBOARD DATA
|
||||||
|
|
||||||
// console.log('dashData', dashData)
|
// console.log('dashData', dashData)
|
||||||
// loans, payments, recent_transactions [], request_summary
|
// loans, payments, recent_transactions [], request_summary
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full flex flex-col gap-8'>
|
<div className='w-full flex flex-col gap-8'>
|
||||||
<BreadcrumbCom title='Dashboard' paths={['Home', 'Dashboard']} />
|
<BreadcrumbCom title='Dashboard' paths={['Home', 'Dashboard']}/>
|
||||||
|
|
||||||
{(isFetching || isError) ?
|
{(isFetching || isError) ?
|
||||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
{isError ? <p className='text-red-500'>{error.message}</p> : <p className='text-slate-800'>Loading...</p>}
|
{isError ? <p className='text-red-500'>{error.message}</p> :
|
||||||
</div>
|
<p className='text-slate-800'>Loading...</p>}
|
||||||
:
|
</div>
|
||||||
<div className='grid grid-cols-1 gap-8'>
|
:
|
||||||
<div className='w-full grid grid-cols-1 xl:grid-cols-3 gap-8'>
|
<div className='grid grid-cols-1 gap-8'>
|
||||||
<div className='box min-h-[230] justify-between bg-[#F7D9E3] dark:bg-black-box text-black-body dark:text-white-body'>
|
<div className='w-full grid grid-cols-1 xl:grid-cols-3 gap-8'>
|
||||||
<p className='text-base sm:text-lg font-bold hover:text-primary'>Subscriptions</p>
|
<div
|
||||||
<div className='flex flex-wrap gap-2 items-end font-bold'>
|
className='box min-h-[230] justify-between bg-[#F7D9E3] dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
{/* <p className='text-3xl sm:text-[39px]'><span className='text-xl sm:text-2xl'>{dashData?.loans?.currency_text}</span><CustomCounter targetNumber={dashData?.loans?.value} timeInSeconds='1' /></p> */}
|
<p className='text-base sm:text-lg font-bold hover:text-primary'>Subscriptions</p>
|
||||||
<p className='text-xl sm:text-[30px]'><span className='text-lg sm:text-xl'>
|
<div className='flex flex-wrap gap-2 items-end font-bold'>
|
||||||
|
{/* <p className='text-3xl sm:text-[39px]'><span className='text-xl sm:text-2xl'>{dashData?.loans?.currency_text}</span><CustomCounter targetNumber={dashData?.loans?.value} timeInSeconds='1' /></p> */}
|
||||||
|
<p className='text-xl sm:text-[30px]'><span className='text-lg sm:text-xl'>
|
||||||
{/*{dashData?.loans?.currency_text}*/}
|
{/*{dashData?.loans?.currency_text}*/}
|
||||||
</span><CustomCounter targetNumber={formatNumber(dashData?.loans?.value)} timeInSeconds='1' />
|
</span><CustomCounter targetNumber={formatNumber(dashData?.loans?.value)} timeInSeconds='1'/>
|
||||||
</p>
|
</p>
|
||||||
<p className='sm:text-[13.9px]'>{dashData?.loans?.text}</p>
|
<p className='sm:text-[13.9px]'>{dashData?.loans?.text}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='box min-h-[230] justify-between bg-[#CBF0F5] dark:bg-black-box text-black-body dark:text-white-body'>
|
<div
|
||||||
<p className='text-base sm:text-lg font-bold hover:text-primary'>Payments</p>
|
className='box min-h-[230] justify-between bg-[#CBF0F5] dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
<div className='flex flex-wrap gap-2 items-end font-bold'>
|
<p className='text-base sm:text-lg font-bold hover:text-primary'>Payments</p>
|
||||||
<p className='text-xl sm:text-[30px]'><span className='text-lg sm:text-xl'>
|
<div className='flex flex-wrap gap-2 items-end font-bold'>
|
||||||
|
<p className='text-xl sm:text-[30px]'><span className='text-lg sm:text-xl'>
|
||||||
{dashData?.payments?.currency_text}
|
{dashData?.payments?.currency_text}
|
||||||
</span><CustomCounter targetNumber={formatNumber(dashData?.payments?.value)} timeInSeconds='1' />
|
</span><CustomCounter targetNumber={formatNumber(dashData?.payments?.value)} timeInSeconds='1'/>
|
||||||
</p>
|
</p>
|
||||||
<p className='sm:text-[13.9px]'>{dashData?.payments?.text}</p>
|
<p className='sm:text-[13.9px]'>{dashData?.payments?.text}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='box min-h-[230] justify-between bg-[#CBD4F4] dark:bg-black-box text-black-body dark:text-white-body'>
|
<div
|
||||||
<p className='mb-4 text-base sm:text-lg font-bold hover:text-primary'>Provision Summary</p>
|
className='box min-h-[230] justify-between bg-[#CBD4F4] dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
<div className='grid grid-cols-2 gap-4 font-bold'>
|
<p className='mb-4 text-base sm:text-lg font-bold hover:text-primary'>Provision Summary</p>
|
||||||
{
|
<div className='grid grid-cols-2 gap-4 font-bold'>
|
||||||
Object.values(dashData?.request_summary).map((item, index) => {
|
{
|
||||||
return (
|
Object.values(dashData?.request_summary).map((item, index) => {
|
||||||
<div key={index} className='flex items-center gap-2'>
|
return (
|
||||||
<div className='min-w-10 min-h-10 bg-white-body dark:bg-black-box dark:shadow-[0_0_0_1px_#f9f9f9] rounded-md flex justify-center items-center'>
|
<div key={index} className='flex items-center gap-2'>
|
||||||
<Icons name='sales' />
|
<div
|
||||||
|
className='min-w-10 min-h-10 bg-white-body dark:bg-black-box dark:shadow-[0_0_0_1px_#f9f9f9] rounded-md flex justify-center items-center'>
|
||||||
|
<Icons name='sales'/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p className='font-bold text-base'><CustomCounter
|
||||||
|
targetNumber={Object.values(item)[0]} timeInSeconds='1'/></p>
|
||||||
|
<p className='text-12 text-slate-500'>{Object.keys(item)[0]}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<p className='font-bold text-base'><CustomCounter targetNumber={Object.values(item)[0]} timeInSeconds='1' /></p>
|
|
||||||
<p className='text-12 text-slate-500'>{Object.keys(item)[0]}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<div className='box gap-8 bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
<div className='box gap-8 bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
<div className='grid grid-cols-1 xs:grid-cols-2 gap-4'>
|
<div className='grid grid-cols-1 xs:grid-cols-2 gap-4'>
|
||||||
<div className='flex flex-col gap-1 order-2 xs:order-1'>
|
<div className='flex flex-col gap-1 order-2 xs:order-1'>
|
||||||
<p className='font-bold text-base'>Recent Subscriptions</p>
|
<p className='font-bold text-base'>Recent Subscriptions</p>
|
||||||
{/* <p className='text-12'>Over 500 members</p> */}
|
{/* <p className='text-12'>Over 500 members</p> */}
|
||||||
</div>
|
</div>
|
||||||
{/* <div className='order-1 xs:order-2 text-left xs:text-right'>
|
{/* <div className='order-1 xs:order-2 text-left xs:text-right'>
|
||||||
<button className='font-bold bg-white-aside text-black-body text-12 px-4 py-2 hover:text-primary hover:bg-sky-50 dark:hover:text-white dark:hover:bg-primary dark:text-white-body dark:bg-black-body rounded-md'>+ New Member</button>
|
<button className='font-bold bg-white-aside text-black-body text-12 px-4 py-2 hover:text-primary hover:bg-sky-50 dark:hover:text-white dark:hover:bg-primary dark:text-white-body dark:bg-black-body rounded-md'>+ New Member</button>
|
||||||
</div> */}
|
</div> */}
|
||||||
</div>
|
|
||||||
|
|
||||||
<table className="py-2 w-full text-sm">
|
|
||||||
<thead className="py-2 text-sm text-slate-500 text-left font-semibold">
|
|
||||||
<tr>
|
|
||||||
<th scope="col" className="px-2 py-2">
|
|
||||||
Subscription
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-2">
|
|
||||||
Status
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-2">
|
|
||||||
Activity
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-2 text-right">
|
|
||||||
Action
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{(dashData?.subscription && dashData?.subscription.length > 0) ? dashData?.subscription?.map((item, index) => {
|
|
||||||
if(index <= 10) {
|
|
||||||
return (
|
|
||||||
<tr key={item?.id} className="py-2 border-t border-dashed border-slate-300">
|
|
||||||
<td className="px-2 py-2">
|
|
||||||
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
|
||||||
<img className="w-10 h-10 rounded-md" src={localImgLoader(`loan_icons/select_offer.png`)} alt="Icon" />
|
|
||||||
<div className="text-left">
|
|
||||||
<div className="text-base font-semibold">{item?.product_id}</div>
|
|
||||||
<div className="font-normal text-gray-500">{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="px-2">
|
|
||||||
<div className="text-left">
|
|
||||||
<div className="text-base font-semibold"><a href={`https://${item?.internal_url}`} target='_blank' rel="noreferrer">{item?.internal_url}</a></div>
|
|
||||||
<div className="font-normal text-gray-500">{item?.status}</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="px-2">
|
|
||||||
<div className="text-left">
|
|
||||||
<div className="font-normal text-gray-500">50%</div>
|
|
||||||
<div className="relative h-[6px] w-full bg-white-body dark:bg-black-body rounded-full overflow-hidden">
|
|
||||||
<div className={`absolute left-0 h-full w-1/2 bg-emerald-600`}></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="px-2 text-right">
|
|
||||||
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
|
||||||
{/* <div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
|
||||||
<Icons name='edit' />
|
|
||||||
</div> */}
|
|
||||||
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
|
||||||
<Link to={RouteLinks.transaction_details_page} state={{transactionID: item?.transaction_id}}>
|
|
||||||
<Icons name='eye' />
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
{/* <div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
|
||||||
<Icons name='trash' />
|
|
||||||
</div> */}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
)
|
|
||||||
}else{
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
:
|
|
||||||
<tr className="py-2 border-t border-dashed border-slate-300">
|
|
||||||
<td className="px-3 py-2" colSpan={4}>
|
|
||||||
<div className="flex justify-center items-center">
|
|
||||||
No Record Found
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
<>
|
|
||||||
{dashData?.subscription.length > 10 &&
|
|
||||||
<tr className="py-2 border-t border-dashed text-right text-primary border-slate-300">
|
|
||||||
<td className="px-3 py-2" colSpan={4}>
|
|
||||||
<Link to={RouteLinks.transactionsPage} className="flex justify-end items-center">
|
|
||||||
More ...
|
|
||||||
</Link>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
<table className="py-2 w-full text-sm">
|
||||||
|
<thead className="py-2 text-sm text-slate-500 text-left font-semibold">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" className="px-2 py-2">
|
||||||
|
Subscription
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Status
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Activity
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2 text-right">
|
||||||
|
Action
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{(dashData?.subscription && dashData?.subscription.length > 0) ? dashData?.subscription?.map((item, index) => {
|
||||||
|
if (index <= 10) {
|
||||||
|
return (
|
||||||
|
<tr key={item?.id} className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-2 py-2">
|
||||||
|
<div
|
||||||
|
className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
||||||
|
<img className="w-10 h-10 rounded-md"
|
||||||
|
src={localImgLoader(`loan_icons/select_offer.png`)}
|
||||||
|
alt="Icon"/>
|
||||||
|
<div className="text-left">
|
||||||
|
<div
|
||||||
|
className="text-base font-semibold">{item?.product_id}</div>
|
||||||
|
<div
|
||||||
|
className="font-normal text-gray-500">{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold"><a
|
||||||
|
href={`https://${item?.internal_url}`} target='_blank'
|
||||||
|
rel="noreferrer">{item?.internal_url}</a></div>
|
||||||
|
<div className="font-normal text-gray-500">{item?.status}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="font-normal text-gray-500">50%</div>
|
||||||
|
<div
|
||||||
|
className="relative h-[6px] w-full bg-white-body dark:bg-black-body rounded-full overflow-hidden">
|
||||||
|
<div
|
||||||
|
className={`absolute left-0 h-full w-1/2 bg-emerald-600`}></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2 text-right">
|
||||||
|
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
||||||
|
<div
|
||||||
|
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||||
|
<Link to={`/subscription-view/${item?.uid}`}
|
||||||
|
state={{subscriptionUID: item?.uid}}
|
||||||
|
>
|
||||||
|
<Icons name='eye'/>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={4}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
<>
|
||||||
|
{dashData?.subscription.length > 10 &&
|
||||||
|
<tr className="py-2 border-t border-dashed text-right text-primary border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={4}>
|
||||||
|
<Link to={RouteLinks.transactionsPage}
|
||||||
|
className="flex justify-end items-center">
|
||||||
|
More ...
|
||||||
|
</Link>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
@@ -158,6 +158,8 @@ const asideNavLinks = [
|
|||||||
{
|
{
|
||||||
name: 'Configurations', status: 1, icon: 'arrow-right', subLinks: [
|
name: 'Configurations', status: 1, icon: 'arrow-right', subLinks: [
|
||||||
{name: 'Product Settings', status: 1, icon: 'dot', to: RouteLinks.products},
|
{name: 'Product Settings', status: 1, icon: 'dot', to: RouteLinks.products},
|
||||||
|
{name: 'Product Templates', status: 1, icon: 'dot', to: RouteLinks.productTemplates},
|
||||||
|
{name: 'Custom Templates', status: 1, icon: 'dot', to: RouteLinks.customTemplates},
|
||||||
{name: 'Admin Manager', status: 1, icon: 'dot', to: RouteLinks.usersAdmin},
|
{name: 'Admin Manager', status: 1, icon: 'dot', to: RouteLinks.usersAdmin},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,146 @@
|
|||||||
|
import { useState } from 'react'
|
||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
|
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||||
|
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
||||||
|
import Icons from '../Icons'
|
||||||
|
import { getCustomTemplate } from '../../services/siteServices'
|
||||||
|
import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString'
|
||||||
|
|
||||||
|
export default function CustomTemplates() {
|
||||||
|
|
||||||
|
const [page, setPage] = useState(1)
|
||||||
|
const [filter, setFilter] = useState({type: '', id: ''})
|
||||||
|
const [willFilter, setWillFilter] = useState(false)
|
||||||
|
|
||||||
|
const handleFilter = ({target:{name, value}}) => {
|
||||||
|
setFilter(prev => ({...prev, [name]:value}))
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleFilterByParams = () => {
|
||||||
|
if(filter.type && !filter.id){
|
||||||
|
return
|
||||||
|
}else if(!filter.type){
|
||||||
|
setPage(1)
|
||||||
|
setWillFilter(prev => !prev)
|
||||||
|
setFilter({type: '', id: ''})
|
||||||
|
}else{
|
||||||
|
setPage(1)
|
||||||
|
setWillFilter(prev => !prev)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: [...queryKeys.custom_template, page, willFilter],
|
||||||
|
queryFn: () => {
|
||||||
|
const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||||
|
const reqData = {
|
||||||
|
page,
|
||||||
|
...filterData
|
||||||
|
}
|
||||||
|
return getCustomTemplate(reqData)
|
||||||
|
},
|
||||||
|
staleTime: 0 //0 mins
|
||||||
|
})
|
||||||
|
const customTemData = data?.data?.templates // CUSTOM TEMPLATE LIST
|
||||||
|
const pagination = data?.data?.pagination
|
||||||
|
// console.log('DATA', data?.data)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='w-full flex flex-col gap-8'>
|
||||||
|
<BreadcrumbCom title='Custom Templates' paths={['Dashboard', 'Custom Templates']} />
|
||||||
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body' style={{backgroundColor: 'aliceblue'}}>
|
||||||
|
<b>Add New Custom Template</b>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
|
{ isError ?
|
||||||
|
<p className='text-red-500'>{error?.message}</p>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
{/* filter section */}
|
||||||
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||||
|
<Icons name='filter' className='text-3xl' />
|
||||||
|
<div className='w-full sm:max-w-48'>
|
||||||
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
||||||
|
<option value=''>All</option>
|
||||||
|
<option value='custom_id'>Custom ID</option>
|
||||||
|
<option value='provision_name'>Provision Name</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className='w-full sm:max-w-48'>
|
||||||
|
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
||||||
|
</div>
|
||||||
|
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
||||||
|
</div>
|
||||||
|
{/* end of filter section */}
|
||||||
|
|
||||||
|
<TablePaginatedWrapper data={customTemData} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||||
|
{({ data }) => (
|
||||||
|
<>
|
||||||
|
<table className="py-2 w-full text-sm">
|
||||||
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" className="px-2 py-2">
|
||||||
|
ID
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Custom ID
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Provision Name
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2 text-right">
|
||||||
|
Status
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||||
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-2 py-2">
|
||||||
|
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.custom_id}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.provision_name}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-right">
|
||||||
|
<div className="text-base font-semibold">{item?.status}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={4}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</TablePaginatedWrapper>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
import { useState } from 'react'
|
||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
|
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||||
|
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
||||||
|
import Icons from '../Icons'
|
||||||
|
import { getProductsTemplate } from '../../services/siteServices'
|
||||||
|
// import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString'
|
||||||
|
|
||||||
|
export default function ProductTemplates() {
|
||||||
|
|
||||||
|
const [page, setPage] = useState(1)
|
||||||
|
const [filter, setFilter] = useState({type: '', id: ''})
|
||||||
|
const [willFilter, setWillFilter] = useState(false)
|
||||||
|
|
||||||
|
const handleFilter = ({target:{name, value}}) => {
|
||||||
|
setFilter(prev => ({...prev, [name]:value}))
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleFilterByParams = () => {
|
||||||
|
if(filter.type && !filter.id){
|
||||||
|
return
|
||||||
|
}else if(!filter.type){
|
||||||
|
setPage(1)
|
||||||
|
setWillFilter(prev => !prev)
|
||||||
|
setFilter({type: '', id: ''})
|
||||||
|
}else{
|
||||||
|
setPage(1)
|
||||||
|
setWillFilter(prev => !prev)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: [...queryKeys.products_template, page, willFilter],
|
||||||
|
queryFn: () => {
|
||||||
|
const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||||
|
const reqData = {
|
||||||
|
page,
|
||||||
|
...filterData
|
||||||
|
}
|
||||||
|
return getProductsTemplate(reqData)
|
||||||
|
},
|
||||||
|
staleTime: 0 //0 mins
|
||||||
|
})
|
||||||
|
const productsTemData = data?.data?.templates // PRODUCTS TEMPLATE LIST
|
||||||
|
const pagination = data?.data?.pagination
|
||||||
|
// console.log('DATA', data?.data)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='w-full flex flex-col gap-8'>
|
||||||
|
<BreadcrumbCom title='Product Templates' paths={['Dashboard', 'Product Templates']} />
|
||||||
|
|
||||||
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
|
{ isError ?
|
||||||
|
<p className='text-red-500'>{error?.message}</p>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
{/* filter section */}
|
||||||
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||||
|
<Icons name='filter' className='text-3xl' />
|
||||||
|
<div className='w-full sm:max-w-48'>
|
||||||
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
||||||
|
<option value=''>All</option>
|
||||||
|
<option value='name'>Name</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className='w-full sm:max-w-48'>
|
||||||
|
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
||||||
|
</div>
|
||||||
|
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
||||||
|
</div>
|
||||||
|
{/* end of filter section */}
|
||||||
|
|
||||||
|
<TablePaginatedWrapper data={productsTemData} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||||
|
{({ data }) => (
|
||||||
|
<>
|
||||||
|
<table className="py-2 w-full text-sm">
|
||||||
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" className="px-2 py-2">
|
||||||
|
Product ID
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Name
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2">
|
||||||
|
Provision Name
|
||||||
|
</th>
|
||||||
|
<th scope="col" className="px-2 text-right">
|
||||||
|
Status
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||||
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-2 py-2">
|
||||||
|
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.product_id}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.name}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold">{item?.provision_name}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-right">
|
||||||
|
<div className="text-base font-semibold">{item?.status}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={4}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</TablePaginatedWrapper>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
import {useLocation, useNavigate, Link} from 'react-router-dom'
|
||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
import { FaCaretDown } from "react-icons/fa";
|
||||||
|
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||||
|
import {useEffect} from 'react';
|
||||||
|
import RouteLinks from '../../RouteLinks';
|
||||||
|
import { getSubscriptionsView } from '../../services/siteServices'
|
||||||
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
|
export default function SubscriptionViewCom() {
|
||||||
|
|
||||||
|
|
||||||
|
const {state} = useLocation()
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!state?.subscriptionUID) {
|
||||||
|
navigate(RouteLinks.homePage, {replace: true})
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: queryKeys.subscriptions_view,
|
||||||
|
queryFn: () => {
|
||||||
|
// const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||||
|
const reqData = {
|
||||||
|
subscription_uid: state?.subscriptionUID
|
||||||
|
// page,
|
||||||
|
// ...filterData
|
||||||
|
}
|
||||||
|
return getSubscriptionsView(reqData)
|
||||||
|
},
|
||||||
|
staleTime: 0 //0 mins
|
||||||
|
})
|
||||||
|
const subscriptionViewData = data?.data // ACCOUNT VIEW DATA
|
||||||
|
console.log('subscriptionViewData', subscriptionViewData)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='w-full flex flex-col gap-8'>
|
||||||
|
<BreadcrumbCom title={`Subscription View [${state?.subscriptionUID}]`} paths={['Dashboard', 'Subscription View']}/>
|
||||||
|
|
||||||
|
{isFetching ?
|
||||||
|
<>
|
||||||
|
<p className='text-slate-800'>Loading...</p>
|
||||||
|
</>
|
||||||
|
: isError ?
|
||||||
|
<p className='text-red-500'>{error.message}</p>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
Repeat the Subscription at the top
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
|
|
||||||
|
<div className='w-full'>
|
||||||
|
<label className='font-medium'>Assign Template</label>
|
||||||
|
<div className='flex flex-col md:flex-row md:items-center gap-2'>
|
||||||
|
<div className='w-full relative'>
|
||||||
|
<select className='w-full p-2'>
|
||||||
|
<option value=''>None</option>
|
||||||
|
</select>
|
||||||
|
<FaCaretDown className='text-base absolute top-1/2 -translate-y-1/2 right-2' />
|
||||||
|
</div>
|
||||||
|
<button>Update</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
|
|
||||||
|
<div className='w-full'>
|
||||||
|
<label className='font-medium'>Assign Custom Template</label>
|
||||||
|
<div className='flex flex-col md:flex-row md:items-center gap-2'>
|
||||||
|
<div className='w-full relative'>
|
||||||
|
<select className='w-full p-2'>
|
||||||
|
<option value=''>None</option>
|
||||||
|
</select>
|
||||||
|
<FaCaretDown className='text-base absolute top-1/2 -translate-y-1/2 right-2' />
|
||||||
|
</div>
|
||||||
|
<button>Update</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
import { useState } from 'react'
|
import {useState} from 'react'
|
||||||
|
import {Link} from 'react-router-dom'
|
||||||
|
|
||||||
// import {Link} from 'react-router-dom'
|
// import {Link} from 'react-router-dom'
|
||||||
import { useQuery } from '@tanstack/react-query'
|
import {useQuery} from '@tanstack/react-query'
|
||||||
import queryKeys from '../../services/queryKeys'
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||||
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
||||||
import Icons from '../Icons'
|
import Icons from '../Icons'
|
||||||
import { getSubscriptions } from '../../services/siteServices'
|
import {getSubscriptions} from '../../services/siteServices'
|
||||||
import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString';
|
import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString';
|
||||||
// import localImgLoader from '../../helpers/localImageLoader';
|
// import localImgLoader from '../../helpers/localImageLoader';
|
||||||
// import RouteLinks from '../../RouteLinks';
|
// import RouteLinks from '../../RouteLinks';
|
||||||
@@ -17,18 +19,18 @@ export default function SubscriptionsCom() {
|
|||||||
const [filter, setFilter] = useState({type: '', id: ''})
|
const [filter, setFilter] = useState({type: '', id: ''})
|
||||||
const [willFilter, setWillFilter] = useState(false)
|
const [willFilter, setWillFilter] = useState(false)
|
||||||
|
|
||||||
const handleFilter = ({target:{name, value}}) => {
|
const handleFilter = ({target: {name, value}}) => {
|
||||||
setFilter(prev => ({...prev, [name]:value}))
|
setFilter(prev => ({...prev, [name]: value}))
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleFilterByParams = () => {
|
const handleFilterByParams = () => {
|
||||||
if(filter.type && !filter.id){
|
if (filter.type && !filter.id) {
|
||||||
return
|
return
|
||||||
}else if(!filter.type){
|
} else if (!filter.type) {
|
||||||
setPage(1)
|
setPage(1)
|
||||||
setWillFilter(prev => !prev)
|
setWillFilter(prev => !prev)
|
||||||
setFilter({type: '', id: ''})
|
setFilter({type: '', id: ''})
|
||||||
}else{
|
} else {
|
||||||
setPage(1)
|
setPage(1)
|
||||||
setWillFilter(prev => !prev)
|
setWillFilter(prev => !prev)
|
||||||
}
|
}
|
||||||
@@ -51,94 +53,123 @@ export default function SubscriptionsCom() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full flex flex-col gap-8'>
|
<div className='w-full flex flex-col gap-8'>
|
||||||
<BreadcrumbCom title='Provisions' paths={['Dashboard', 'Provisions']} />
|
<BreadcrumbCom title='Provisions' paths={['Dashboard', 'Provisions']}/>
|
||||||
|
|
||||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
{ isError ?
|
{isError ?
|
||||||
<p className='text-red-500'>{error?.message}</p>
|
<p className='text-red-500'>{error?.message}</p>
|
||||||
:
|
:
|
||||||
<>
|
<>
|
||||||
{/* filter section */}
|
{/* filter section */}
|
||||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||||
<Icons name='filter' className='text-3xl' />
|
<Icons name='filter' className='text-3xl'/>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
|
||||||
<option value=''>All</option>
|
onChange={handleFilter}>
|
||||||
<option value='member_id'>Member ID</option>
|
<option value=''>All</option>
|
||||||
<option value='product_id'>Product ID</option>
|
<option value='member_id'>Member ID</option>
|
||||||
</select>
|
<option value='product_id'>Product ID</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className='w-full sm:max-w-48'>
|
||||||
|
<input name='id' value={filter?.id} disabled={!filter.type}
|
||||||
|
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
|
||||||
|
onChange={handleFilter}/>
|
||||||
|
</div>
|
||||||
|
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
|
||||||
|
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full sm:max-w-48'>
|
{/* end of filter section */}
|
||||||
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
|
||||||
</div>
|
|
||||||
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
|
||||||
</div>
|
|
||||||
{/* end of filter section */}
|
|
||||||
|
|
||||||
<TablePaginatedWrapper data={subscriptionData} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
<TablePaginatedWrapper data={subscriptionData} isFetching={isFetching} setPage={setPage}
|
||||||
{({ data }) => (
|
itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||||
<>
|
{({data}) => (
|
||||||
<table className="py-2 w-full text-sm">
|
<>
|
||||||
<thead className="py-2 text-sm text-slate-500 text-left">
|
<table className="py-2 w-full text-sm">
|
||||||
<tr>
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
<th scope="col" className="px-2 py-2">
|
<tr>
|
||||||
Added
|
<th scope="col" className="px-2 py-2">
|
||||||
</th>
|
Added/Updated
|
||||||
<th scope="col" className="px-2">
|
</th>
|
||||||
Product
|
<th scope="col" className="px-2">
|
||||||
</th>
|
Product
|
||||||
<th scope="col" className="px-2">
|
</th>
|
||||||
URL
|
<th scope="col" className="px-2">
|
||||||
</th>
|
Internal-URL/External-URL/SubscriptionUID
|
||||||
<th scope="col" className="px-2 text-right">
|
</th>
|
||||||
Status
|
<th scope="col" className="px-2 text-right">
|
||||||
</th>
|
Status
|
||||||
</tr>
|
</th>
|
||||||
</thead>
|
<th scope="col" className="px-2 text-right">
|
||||||
<tbody>
|
Action
|
||||||
{(data && data.length > 0) ? data?.map((item, index) => (
|
</th>
|
||||||
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
|
||||||
<td className="px-2 py-2">
|
|
||||||
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
|
||||||
{/* <img className="w-10 h-10 rounded-md" src={localImgLoader(`loan_icons/${item?.type}.png`)} alt="Icon" /> */}
|
|
||||||
<div className="text-left">
|
|
||||||
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="px-2">
|
|
||||||
<div className="text-left">
|
|
||||||
<div className="text-base font-semibold">{item?.product_id}</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="px-2">
|
|
||||||
<div className="text-left">
|
|
||||||
<div className="text-base font-semibold">{item?.internal_url}</div>
|
|
||||||
<div className="font-normal text-gray-500">{item?.external_url}</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="px-2">
|
|
||||||
<div className="text-right">
|
|
||||||
<div className="text-base font-semibold">{item?.status}</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
))
|
</thead>
|
||||||
:
|
<tbody>
|
||||||
<tr className="py-2 border-t border-dashed border-slate-300">
|
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||||
<td className="px-3 py-2" colSpan={4}>
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
<div className="flex justify-center items-center">
|
<td className="px-2 py-2">
|
||||||
No Record Found
|
<div
|
||||||
</div>
|
className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
||||||
</td>
|
{/* <img className="w-10 h-10 rounded-md" src={localImgLoader(`loan_icons/${item?.type}.png`)} alt="Icon" /> */}
|
||||||
</tr>
|
<div className="text-left">
|
||||||
}
|
<div
|
||||||
</tbody>
|
className="text-base font-semibold">
|
||||||
</table>
|
{getDateTimeFromDateString(item?.added)}<br />
|
||||||
</>
|
{getDateTimeFromDateString(item?.updated)}<br />
|
||||||
)}
|
</div>
|
||||||
</TablePaginatedWrapper>
|
</div>
|
||||||
</>
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div
|
||||||
|
className="text-base font-semibold">{item?.product_id}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-left">
|
||||||
|
<div className="text-base font-semibold ">
|
||||||
|
<span>Int :</span> {item?.internal_url}<br/>
|
||||||
|
<span>Ext :</span> {item?.external_url}<br/>
|
||||||
|
{item?.subscription_uid}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2">
|
||||||
|
<div className="text-right">
|
||||||
|
<div className="text-base font-semibold">{item?.status}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td className="px-2 text-right">
|
||||||
|
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
||||||
|
<div
|
||||||
|
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||||
|
<Link to={`/subscription-view/${item?.subscription_uid}`}
|
||||||
|
state={{customerID: item?.id, subscriptionUID: item?.subscription_uid}}
|
||||||
|
>
|
||||||
|
<Icons name='eye'/>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
:
|
||||||
|
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||||
|
<td className="px-3 py-2" colSpan={4}>
|
||||||
|
<div className="flex justify-center items-center">
|
||||||
|
No Record Found
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</TablePaginatedWrapper>
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,12 +62,13 @@ export default function UsersAdmin() {
|
|||||||
:
|
:
|
||||||
<>
|
<>
|
||||||
{/* filter section */}
|
{/* filter section */}
|
||||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2' >
|
||||||
<Icons name='filter' className='text-3xl' />
|
<Icons name='filter' className='text-3xl' />
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
||||||
<option value=''>All</option>
|
<option value=''>All</option>
|
||||||
<option value='name'>Name</option>
|
<option value='name'>Name</option>
|
||||||
|
<option value='username'>Username</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
@@ -90,7 +91,7 @@ export default function UsersAdmin() {
|
|||||||
Added
|
Added
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" className="px-2">
|
<th scope="col" className="px-2">
|
||||||
Firstnane
|
Firstname
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" className="px-2">
|
<th scope="col" className="px-2">
|
||||||
Lastname
|
Lastname
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import AccountViewCom from "../components/account_view/AccountViewCom";
|
||||||
|
export default function AccountDetailsPage() {
|
||||||
|
return (
|
||||||
|
<AccountViewCom />
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import CustomTemplates from "../components/products/CustomTemplates";
|
||||||
|
|
||||||
|
export default function CustomTemplatePage() {
|
||||||
|
return (
|
||||||
|
<CustomTemplates />
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import ProductTemplates from "../components/products/ProductTemplates";
|
||||||
|
|
||||||
|
export default function ProductTemplatePage() {
|
||||||
|
return (
|
||||||
|
<ProductTemplates />
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import SubscriptionViewCom from "../components/subscription_view/SubscriptionViewCom";
|
||||||
|
export default function SubscriptionDetailsPage() {
|
||||||
|
return (
|
||||||
|
<SubscriptionViewCom />
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -17,6 +17,10 @@ const queryKeys = {
|
|||||||
right_sidebar: ['right_sidebar'],
|
right_sidebar: ['right_sidebar'],
|
||||||
recent_signup: ['recent_signup'],
|
recent_signup: ['recent_signup'],
|
||||||
products: ['products'],
|
products: ['products'],
|
||||||
|
products_template: ['products_template'],
|
||||||
|
custom_template: ['custom_template'],
|
||||||
|
account_view: ['account_view'],
|
||||||
|
subscriptions_view: ['subscriptions_view'],
|
||||||
users_admin: ['users_admin'],
|
users_admin: ['users_admin'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,11 +98,29 @@ export const getUsers = (reqData) => {
|
|||||||
return getAuxEnd(`/users`, postData)
|
return getAuxEnd(`/users`, postData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET PRODUCTS TEMPLATE DATA
|
||||||
|
export const getProductsTemplate = (reqData) => {
|
||||||
|
const postData = { ...reqData }
|
||||||
|
return getAuxEnd(`/products-templates`, postData)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET CUSTOM TEMPLATE DATA
|
||||||
|
export const getCustomTemplate = (reqData) => {
|
||||||
|
const postData = { ...reqData }
|
||||||
|
return getAuxEnd(`/custom-templates`, postData)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO VIEW SELECTED ACCOUNT DATA
|
||||||
|
export const getAccountView = (reqData) => {
|
||||||
|
const postData = { ...reqData }
|
||||||
|
return getAuxEnd(`/account-view`, postData)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET SUBSCRIPTIONS VIEW DATA
|
||||||
|
export const getSubscriptionsView = (reqData) => {
|
||||||
|
const postData = { ...reqData }
|
||||||
|
return getAuxEnd(`/subcription-view`, postData)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// FUNCTION TO GET LOANS TABLE
|
// FUNCTION TO GET LOANS TABLE
|
||||||
|
|||||||
Reference in New Issue
Block a user