diff options
author | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-07-26 21:21:03 +0530 |
---|---|---|
committer | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-07-26 21:21:03 +0530 |
commit | 55aed6d7c2df0daedbdabea0d1727acb1815ce2b (patch) | |
tree | 42dabdc4f68bd01867cd84c4a9beaa6a14ffb9c2 /src/pages | |
parent | 4833cc911b004b3da476863ddf27e09d93dd89c0 (diff) | |
download | admin-panel-55aed6d7c2df0daedbdabea0d1727acb1815ce2b.tar.gz admin-panel-55aed6d7c2df0daedbdabea0d1727acb1815ce2b.tar.bz2 admin-panel-55aed6d7c2df0daedbdabea0d1727acb1815ce2b.zip |
added upload feature
Diffstat (limited to 'src/pages')
-rw-r--r-- | src/pages/ManageAds.jsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pages/ManageAds.jsx b/src/pages/ManageAds.jsx index 834a898..88fc3b0 100644 --- a/src/pages/ManageAds.jsx +++ b/src/pages/ManageAds.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react'; import AdCard from '../components/AdCard'; import AdForm from '../components/AdForm'; +import UploadForm from '../components/UploadForm'; import { fetchAds, addAd } from '../utils/api'; const ManageAds = () => { @@ -19,10 +20,16 @@ const ManageAds = () => { setAds([...ads, ad]); }; + const handleUploadComplete = (url) => { + console.log('Uploaded file URL:', url); + // You can add logic here to save the uploaded file URL to your backend if needed + }; + return ( <div> <h1>Manage Ads</h1> <AdForm onAddAd={handleAddAd} /> + <UploadForm onUploadComplete={handleUploadComplete} /> <div> {ads.map((ad) => ( <AdCard key={ad.id} ad={ad} /> |