feat: implement dashboard contents page with data table and styling
This commit is contained in:
parent
929f5c91b0
commit
e476e3a3ad
@ -1,8 +1,13 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
|
||||||
@import 'tailwindcss';
|
@import 'tailwindcss';
|
||||||
|
|
||||||
@plugin "@tailwindcss/typography";
|
@plugin "@tailwindcss/typography";
|
||||||
|
|
||||||
|
@import 'datatables.net-dt';
|
||||||
|
/* @import 'datatables.net-responsive-dt';
|
||||||
|
@import 'datatables.net-select-dt'; */
|
||||||
|
|
||||||
@theme {
|
@theme {
|
||||||
--font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif,
|
--font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif,
|
||||||
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||||
|
|||||||
102
app/pages/dashboard-contents/data.ts
Normal file
102
app/pages/dashboard-contents/data.ts
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
type TContens = {
|
||||||
|
id: number
|
||||||
|
createdAt: string
|
||||||
|
author: string
|
||||||
|
title: string
|
||||||
|
tags: string
|
||||||
|
category: string
|
||||||
|
status: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CONTENTS: TContens[] = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'John Doe',
|
||||||
|
title: 'Introduction to TypeScript',
|
||||||
|
tags: 'typescript, programming',
|
||||||
|
category: 'Education',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Jane Smith',
|
||||||
|
title: 'Advanced React Patterns',
|
||||||
|
tags: 'react, javascript',
|
||||||
|
category: 'Development',
|
||||||
|
status: 'Draft',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Alice Johnson',
|
||||||
|
title: 'Understanding Redux',
|
||||||
|
tags: 'redux, state management',
|
||||||
|
category: 'Development',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Bob Brown',
|
||||||
|
title: 'CSS Grid Layout',
|
||||||
|
tags: 'css, design',
|
||||||
|
category: 'Design',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Charlie Davis',
|
||||||
|
title: 'Node.js Best Practices',
|
||||||
|
tags: 'nodejs, backend',
|
||||||
|
category: 'Development',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Diana Evans',
|
||||||
|
title: 'GraphQL for Beginners',
|
||||||
|
tags: 'graphql, api',
|
||||||
|
category: 'Development',
|
||||||
|
status: 'Draft',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 7,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Evan Harris',
|
||||||
|
title: 'Building RESTful APIs',
|
||||||
|
tags: 'rest, api',
|
||||||
|
category: 'Development',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 8,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Fiona Green',
|
||||||
|
title: 'Introduction to Docker',
|
||||||
|
tags: 'docker, devops',
|
||||||
|
category: 'DevOps',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 9,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'George King',
|
||||||
|
title: 'Microservices Architecture',
|
||||||
|
tags: 'microservices, architecture',
|
||||||
|
category: 'Development',
|
||||||
|
status: 'Draft',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 10,
|
||||||
|
createdAt: '24/10/2024',
|
||||||
|
author: 'Hannah Lee',
|
||||||
|
title: 'Kubernetes Essentials',
|
||||||
|
tags: 'kubernetes, devops',
|
||||||
|
category: 'DevOps',
|
||||||
|
status: 'Published',
|
||||||
|
},
|
||||||
|
]
|
||||||
36
app/pages/dashboard-contents/index.tsx
Normal file
36
app/pages/dashboard-contents/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 ContentsPage = () => {
|
||||||
|
DataTable.use(DT)
|
||||||
|
const columns = [
|
||||||
|
{ title: 'No', data: 'id' },
|
||||||
|
{ title: 'Tanggal Kontent', data: 'createdAt' },
|
||||||
|
{ title: 'Nama Penulis', data: 'author' },
|
||||||
|
{ title: 'Judul', data: 'title' },
|
||||||
|
{ title: 'Kategori', data: 'category' },
|
||||||
|
{ title: 'Tags', data: 'tags' },
|
||||||
|
{ title: 'Action', data: 'id', render: () => 'Edit' },
|
||||||
|
]
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative">
|
||||||
|
<TitleDashboard title="Konten" />
|
||||||
|
<DataTable
|
||||||
|
className="cell-border"
|
||||||
|
data={CONTENTS}
|
||||||
|
columns={columns}
|
||||||
|
options={{
|
||||||
|
paging: true,
|
||||||
|
searching: true,
|
||||||
|
ordering: true,
|
||||||
|
info: true,
|
||||||
|
}}
|
||||||
|
></DataTable>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -1,4 +1,6 @@
|
|||||||
|
import { ContentsPage } from '~/pages/dashboard-contents'
|
||||||
|
|
||||||
const DashboardContentsLayout = () => {
|
const DashboardContentsLayout = () => {
|
||||||
return <div>Contents Page</div>
|
return <ContentsPage />
|
||||||
}
|
}
|
||||||
export default DashboardContentsLayout
|
export default DashboardContentsLayout
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user