Compare commits

..

No commits in common. "aca894729e47280919b626773c06377b41eb47d0" and "1758b7837ed37acab832f1137680fdff630d23c5" have entirely different histories.

2 changed files with 56 additions and 73 deletions

View File

@ -3,7 +3,6 @@ import { useState } from 'react'
import { twMerge } from 'tailwind-merge'
import { PlusIcon } from '~/components/icons/plus'
import { Button } from '~/components/ui/button'
import { UiTable } from '~/components/ui/table'
import { TitleDashboard } from '~/components/ui/title-dashboard'
import { BANNER } from '~/data/contents'
@ -20,7 +19,6 @@ export const AdvertisementsPage = ({
}: BannerUploadProperties) => {
const [banner, setBanner] = useState<File | null>()
const [link, setLink] = useState<string>('')
const [listAdvertisement, setListAdvertisement] = useState(true)
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const file = event.target.files?.[0] || undefined
@ -74,14 +72,9 @@ export const AdvertisementsPage = ({
},
}
const switchView = () => {
setListAdvertisement(!listAdvertisement)
}
return (
<div className="relative">
<TitleDashboard title="Advertisement" />
{listAdvertisement && (
<div className="flex gap-5">
<div className="w-[400px] rounded-xl bg-gray-50 py-6">
<Field className="mb-6">
@ -132,24 +125,13 @@ export const AdvertisementsPage = ({
</div>
</div>
)}
<Button
size="lg"
className="mt-6 ml-auto flex-none rounded"
onClick={switchView}
>
List Advertisement
</Button>
</div>
)}
{!listAdvertisement && (
<UiTable
data={dataBanner}
columns={dataColumns}
slots={dataSlot}
title="Daftar Banner"
/>
)}
</div>
)
}

View File

@ -52,6 +52,7 @@ export const ContentsPage = () => {
searching: true,
ordering: true,
info: true,
// scrollY: '50vh',
}
return (