feat: add start_date and end_date fields to advertisements with transformation and display in forms
This commit is contained in:
@@ -14,6 +14,7 @@ import { Button } from '~/components/ui/button'
|
||||
import { UiTable } from '~/components/ui/table'
|
||||
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||
import type { loader } from '~/routes/_admin.lg-admin._dashboard.advertisements._index'
|
||||
import { formatDate } from '~/utils/formatter'
|
||||
|
||||
export const AdvertisementsPage = () => {
|
||||
const loaderData = useRouteLoaderData<typeof loader>(
|
||||
@@ -36,6 +37,20 @@ export const AdvertisementsPage = () => {
|
||||
},
|
||||
{ title: 'Banner', data: 'image_url' },
|
||||
{ title: 'Link', data: 'url' },
|
||||
{
|
||||
title: 'Tanggal Mulai',
|
||||
data: 'start_date',
|
||||
render: (data: string) => {
|
||||
return formatDate(data)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Tanggal Berakhir',
|
||||
data: 'end_date',
|
||||
render: (data: string) => {
|
||||
return formatDate(data)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Action',
|
||||
data: 'id',
|
||||
@@ -51,7 +66,7 @@ export const AdvertisementsPage = () => {
|
||||
/>
|
||||
)
|
||||
},
|
||||
3: (value: string, _type: unknown, data: TAdResponse) => (
|
||||
5: (value: string, _type: unknown, data: TAdResponse) => (
|
||||
<div className="flex space-x-2">
|
||||
<Button
|
||||
as="a"
|
||||
|
||||
Reference in New Issue
Block a user