feat: replace inline button with reusable Button component in dashboard contents

This commit is contained in:
fredy.siswanto 2025-03-02 20:09:09 +07:00
parent cd3637bf03
commit c4297a8167

View File

@ -3,6 +3,7 @@ import DT from 'datatables.net-dt'
import DataTable from 'datatables.net-react'
import { SearchIcon } from '~/components/icons/search'
import { Button } from '~/components/ui/button'
import { TitleDashboard } from '~/components/ui/title-dashboard'
import { CONTENTS } from './data'
@ -27,9 +28,6 @@ export const ContentsPage = () => {
{
title: 'Action',
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"
data={CONTENTS}
columns={columns}
slots={{
6: (value: string | number) => {
return (
<Button
as="a"
href={`${value}`}
>
Lihat Detail
</Button>
)
},
}}
options={{
paging: true,
searching: true,