feat: add subscriptions page with data table and sample data
This commit is contained in:
parent
e476e3a3ad
commit
b7e029546f
21
app/pages/dashboard-subscriptions/data.ts
Normal file
21
app/pages/dashboard-subscriptions/data.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
type TSubscriptions = {
|
||||||
|
id: number
|
||||||
|
createdAt: string
|
||||||
|
date: string
|
||||||
|
name: string
|
||||||
|
email: string
|
||||||
|
category: string
|
||||||
|
status: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CONTENTS: TSubscriptions[] = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
date: '24/10/2024',
|
||||||
|
name: 'John Doe',
|
||||||
|
email: 'test@test.com',
|
||||||
|
category: 'Education',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
]
|
||||||
36
app/pages/dashboard-subscriptions/index.tsx
Normal file
36
app/pages/dashboard-subscriptions/index.tsx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import DT from 'datatables.net-dt'
|
||||||
|
import DataTable from 'datatables.net-react'
|
||||||
|
|
||||||
|
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||||
|
|
||||||
|
import { CONTENTS } from './data'
|
||||||
|
|
||||||
|
export const SubscriptionsPage = () => {
|
||||||
|
DataTable.use(DT)
|
||||||
|
const columns = [
|
||||||
|
{ title: 'No', data: 'id' },
|
||||||
|
{ title: 'Tanggal Subscribe', data: 'date' },
|
||||||
|
{ title: 'Nama User', data: 'name' },
|
||||||
|
{ title: 'Email', data: 'email' },
|
||||||
|
{ title: 'Kategori', data: 'category' },
|
||||||
|
{ title: 'Status', data: 'status' },
|
||||||
|
{ title: 'Action', data: 'id', render: () => 'Subscribed' },
|
||||||
|
]
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative">
|
||||||
|
<TitleDashboard title="Subscription" />
|
||||||
|
<DataTable
|
||||||
|
className="cell-border"
|
||||||
|
data={CONTENTS}
|
||||||
|
columns={columns}
|
||||||
|
options={{
|
||||||
|
paging: true,
|
||||||
|
searching: true,
|
||||||
|
ordering: true,
|
||||||
|
info: true,
|
||||||
|
}}
|
||||||
|
></DataTable>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -1,4 +1,6 @@
|
|||||||
|
import { SubscriptionsPage } from '~/pages/dashboard-subscriptions'
|
||||||
|
|
||||||
const DashboardSubscriptionsLayout = () => {
|
const DashboardSubscriptionsLayout = () => {
|
||||||
return <div>Subscriptions Page</div>
|
return <SubscriptionsPage />
|
||||||
}
|
}
|
||||||
export default DashboardSubscriptionsLayout
|
export default DashboardSubscriptionsLayout
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user