feat: replace inline button with reusable Button component in dashboard contents
This commit is contained in:
parent
cd3637bf03
commit
c4297a8167
@ -3,6 +3,7 @@ import DT from 'datatables.net-dt'
|
|||||||
import DataTable from 'datatables.net-react'
|
import DataTable from 'datatables.net-react'
|
||||||
|
|
||||||
import { SearchIcon } from '~/components/icons/search'
|
import { SearchIcon } from '~/components/icons/search'
|
||||||
|
import { Button } from '~/components/ui/button'
|
||||||
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||||
|
|
||||||
import { CONTENTS } from './data'
|
import { CONTENTS } from './data'
|
||||||
@ -27,9 +28,6 @@ export const ContentsPage = () => {
|
|||||||
{
|
{
|
||||||
title: 'Action',
|
title: 'Action',
|
||||||
data: 'id',
|
data: 'id',
|
||||||
render: () => {
|
|
||||||
return '<button class="bg-[#2E2F7C] text-white px-2 py-1 rounded-md">Lihat Detail</button>'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -70,6 +68,18 @@ export const ContentsPage = () => {
|
|||||||
className="cell-border"
|
className="cell-border"
|
||||||
data={CONTENTS}
|
data={CONTENTS}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
slots={{
|
||||||
|
6: (value: string | number) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
as="a"
|
||||||
|
href={`${value}`}
|
||||||
|
>
|
||||||
|
Lihat Detail
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
}}
|
||||||
options={{
|
options={{
|
||||||
paging: true,
|
paging: true,
|
||||||
searching: true,
|
searching: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user