refactor: update subscription data loading and clean up unused imports in dashboard components

This commit is contained in:
fredy.siswanto
2025-03-09 20:23:26 +07:00
parent 5b83c3f8dd
commit a9a350fdb2
4 changed files with 12 additions and 21 deletions
+5 -8
View File
@@ -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