refactor: update subscription data loading and clean up unused imports in dashboard components
This commit is contained in:
@@ -5,24 +5,22 @@ import { Link, useRouteLoaderData } from 'react-router'
|
||||
import { Button } from '~/components/ui/button'
|
||||
import { UiTable } from '~/components/ui/table'
|
||||
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||
import type { loader } from '~/routes/_admin.lg-admin._dashboard'
|
||||
import type { loader } from '~/routes/_admin.lg-admin._dashboard.subscribe-plan._index'
|
||||
|
||||
export const SubscribePlanPage = () => {
|
||||
const loaderData = useRouteLoaderData<typeof loader>(
|
||||
'routes/_admin.lg-admin._dashboard',
|
||||
'routes/_admin.lg-admin._dashboard.subscribe-plan._index',
|
||||
)
|
||||
|
||||
DataTable.use(DT)
|
||||
|
||||
const { subscriptionsData: dataTable } = loaderData || {}
|
||||
|
||||
const dataColumns = [
|
||||
{
|
||||
title: 'No',
|
||||
render: (
|
||||
data: unknown,
|
||||
type: unknown,
|
||||
row: unknown,
|
||||
_data: unknown,
|
||||
_type: unknown,
|
||||
_row: unknown,
|
||||
meta: { row: number },
|
||||
) => {
|
||||
return meta.row + 1
|
||||
@@ -41,7 +39,6 @@ export const SubscribePlanPage = () => {
|
||||
data: 'id',
|
||||
},
|
||||
]
|
||||
|
||||
const dataSlot = {
|
||||
3: (value: string) => (
|
||||
<Button
|
||||
|
||||
@@ -3,7 +3,6 @@ import DT from 'datatables.net-dt'
|
||||
import DataTable from 'datatables.net-react'
|
||||
|
||||
import { SearchIcon } from '~/components/icons/search'
|
||||
import { Button } from '~/components/ui/button'
|
||||
import { UiTable } from '~/components/ui/table'
|
||||
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||
|
||||
@@ -61,15 +60,6 @@ export const SubscriptionsPage = () => {
|
||||
</Field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
as="a"
|
||||
className="rounded-md"
|
||||
size="lg"
|
||||
href="#"
|
||||
>
|
||||
Subscription Settings
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<UiTable
|
||||
|
||||
Reference in New Issue
Block a user