feat: update content tags and enhance rendering in dashboard data table
This commit is contained in:
@@ -13,25 +13,42 @@ export const ContentsPage = () => {
|
||||
{ title: 'Nama Penulis', data: 'author' },
|
||||
{ title: 'Judul', data: 'title' },
|
||||
{ title: 'Kategori', data: 'category' },
|
||||
{ title: 'Tags', data: 'tags' },
|
||||
{ title: 'Action', data: 'id', render: () => 'Edit' },
|
||||
{
|
||||
title: 'Tags',
|
||||
data: 'tags',
|
||||
render: (value: string) => {
|
||||
return value === 'Normal'
|
||||
? `<span class="bg-[#F5F5F5] text-[#4C5CA0] px-2 py-1 rounded-md">${value}</span>`
|
||||
: `<span class="bg-[#FFFCAF] px-2 py-1 rounded-md">${value}</span>`
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Action',
|
||||
data: 'id',
|
||||
render: () => {
|
||||
return '<button class="bg-[#2E2F7C] text-white px-2 py-1 rounded-md">Lihat Detail</button>'
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<div className="relative">
|
||||
<TitleDashboard title="Konten" />
|
||||
<DataTable
|
||||
className="cell-border"
|
||||
data={CONTENTS}
|
||||
columns={columns}
|
||||
options={{
|
||||
paging: true,
|
||||
searching: true,
|
||||
ordering: true,
|
||||
info: true,
|
||||
// scrollY: '50vh',
|
||||
}}
|
||||
></DataTable>
|
||||
<div className="rounded-lg bg-white p-6 shadow-md">
|
||||
<h3 className="py-1 font-semibold text-[#4C5CA0]">Daftar Content</h3>
|
||||
<DataTable
|
||||
className="cell-border"
|
||||
data={CONTENTS}
|
||||
columns={columns}
|
||||
options={{
|
||||
paging: true,
|
||||
searching: true,
|
||||
ordering: true,
|
||||
info: true,
|
||||
// scrollY: '50vh',
|
||||
}}
|
||||
></DataTable>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user