diff --git a/app/components/icons/medical-notes.tsx b/app/components/icons/medical-notes.tsx deleted file mode 100644 index 610fa2d..0000000 --- a/app/components/icons/medical-notes.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { JSX, SVGProps } from 'react' - -export const MedicalNotesIcon = ( - properties: JSX.IntrinsicAttributes & SVGProps, -) => { - return ( - - - - ) -} diff --git a/app/components/icons/plus.tsx b/app/components/icons/plus.tsx deleted file mode 100644 index 7845c44..0000000 --- a/app/components/icons/plus.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import type { JSX, SVGProps } from 'react' -export const PlusIcon = ( - properties: JSX.IntrinsicAttributes & SVGProps, -) => { - return ( - - - - ) -} diff --git a/app/layouts/admin/menu.ts b/app/layouts/admin/menu.ts index 1ca8692..b3fac6e 100644 --- a/app/layouts/admin/menu.ts +++ b/app/layouts/admin/menu.ts @@ -1,6 +1,7 @@ import { ClipboardDocumentCheckIcon, DocumentCurrencyDollarIcon, + MegaphoneIcon, TagIcon, } from '@heroicons/react/20/solid' import type { SVGProps } from 'react' @@ -8,7 +9,6 @@ import type { SVGProps } from 'react' import { ChartIcon } from '~/components/icons/chart' import { ChatIcon } from '~/components/icons/chat' import { DocumentIcon } from '~/components/icons/document' -import { MedicalNotesIcon } from '~/components/icons/medical-notes' type TMenu = { group: string @@ -39,9 +39,9 @@ export const MENU: TMenu[] = [ icon: ChatIcon, }, { - title: 'Advertisement', + title: 'Banner Iklan', url: '/lg-admin/advertisements', - icon: MedicalNotesIcon, + icon: MegaphoneIcon, }, { title: 'Subscription', diff --git a/app/pages/dashboard-advertisements/index.tsx b/app/pages/dashboard-advertisements/index.tsx index 95def65..819e36d 100644 --- a/app/pages/dashboard-advertisements/index.tsx +++ b/app/pages/dashboard-advertisements/index.tsx @@ -1,42 +1,16 @@ -import { Field, Input, Label, Select } from '@headlessui/react' -import { MagnifyingGlassIcon } from '@heroicons/react/20/solid' import type { ConfigColumns } from 'datatables.net-dt' import type { DataTableSlots } from 'datatables.net-react' -import { useState } from 'react' +import { Link } from 'react-router' 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' -type BannerUploadProperties = { - onBannerChange?: (file: File | undefined) => void - onLinkChange?: (link: string) => void -} type TStatusColors = 'draft' | 'active' | 'inactive' -export const AdvertisementsPage = ({ - onBannerChange, - onLinkChange, -}: BannerUploadProperties) => { - const [banner, setBanner] = useState() - const [link, setLink] = useState('') - const [listAdvertisement, setListAdvertisement] = useState(true) - - const handleFileChange = (event: React.ChangeEvent) => { - const file = event.target.files?.[0] || undefined - setBanner(file) - onBannerChange?.(file) - } - - const handleLinkChange = (event: React.ChangeEvent) => { - const newLink = event.target.value - setLink(newLink) - onLinkChange?.(newLink) - } - +export const AdvertisementsPage = () => { const dataBanner = BANNER const dataColumns: ConfigColumns[] = [ { title: 'No', data: 'id' }, @@ -77,119 +51,28 @@ export const AdvertisementsPage = ({ }, } - const switchView = () => { - setListAdvertisement(!listAdvertisement) - } - return (
- + - {!listAdvertisement && ( -
-
- - - - - +
+
{/* TODO: Filter */}
+ +
- - - - -
- {banner && ( -
-
- Banner Preview -
-
- )} -
- )} - - {listAdvertisement && ( - <> -
-
-
- - -
- -
- -
-
-
-
- -
- - - - -
-
- -
- - - )} +
) }