diff --git a/app/components/icons/plus.tsx b/app/components/icons/plus.tsx new file mode 100644 index 0000000..7845c44 --- /dev/null +++ b/app/components/icons/plus.tsx @@ -0,0 +1,20 @@ +import type { JSX, SVGProps } from 'react' +export const PlusIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/pages/dashboard-advertisements/index.tsx b/app/pages/dashboard-advertisements/index.tsx index 69b2c1e..e103a1e 100644 --- a/app/pages/dashboard-advertisements/index.tsx +++ b/app/pages/dashboard-advertisements/index.tsx @@ -1,9 +1,81 @@ -import { TitleDashboard } from '~/components/ui/title-dashboard' +import { Field, Input, Label } from '@headlessui/react' +import { useState } from 'react' + +import { PlusIcon } from '~/components/icons/plus' + +type BannerUploadProperties = { + onBannerChange?: (file: File | undefined) => void + onLinkChange?: (link: string) => void +} + +export const AdvertisementsPage = ({ + onBannerChange, + onLinkChange, +}: BannerUploadProperties) => { + const [banner, setBanner] = useState() + const [link, setLink] = useState('') + + 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 = () => { return ( -
- +
+ {banner && ( +
+
+ Banner Preview +
+
+ )} + + + + + + + + + +
) }