feat: restructure ads mgmt by creating a new layout for ads creation and updating related schemas

This commit is contained in:
Ardeman
2025-03-12 09:47:21 +08:00
parent 90e2042a91
commit 70cbb134d8
22 changed files with 382 additions and 71 deletions
+5 -6
View File
@@ -3,7 +3,7 @@ import DataTable, { type DataTableSlots } from 'datatables.net-react'
import { Link, useRouteLoaderData } from 'react-router'
import type { TCategoryResponse } from '~/apis/common/get-categories'
import type { TNewsResponse } from '~/apis/common/get-news'
import type { TAuthor } from '~/apis/common/get-news'
import type { TTagResponse } from '~/apis/common/get-tags'
import { Button } from '~/components/ui/button'
import { UiTable } from '~/components/ui/table'
@@ -39,6 +39,7 @@ export const ContentsPage = () => {
},
{
title: 'Penulis',
data: 'author',
},
{ title: 'Judul', data: 'title' },
{
@@ -57,12 +58,10 @@ export const ContentsPage = () => {
]
const dataSlot: DataTableSlots = {
1: (value: string) => formatDate(value),
2: (_value: unknown, _type: unknown, data: TNewsResponse) => (
2: (value: TAuthor) => (
<div>
<div>{data.author.name}</div>
<div className="text-sm text-[#7C7C7C]">
ID: {data.author.id.slice(0, 8)}
</div>
<div>{value.name}</div>
<div className="text-sm text-[#7C7C7C]">ID: {value.id.slice(0, 8)}</div>
</div>
),
3: (value: string) => <span className="text-sm">{value}</span>,