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>
  )
}
