feat: add subscriptions page with data table and sample data
This commit is contained in:
@@ -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',
|
||||
},
|
||||
]
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user