@devvistatech/devvista-kit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/LICENSE +7 -0
- package/README.md +15 -0
- package/app/about/page.tsx +306 -0
- package/app/adRequest/page.tsx +550 -0
- package/app/analytics/page.tsx +347 -0
- package/app/api/about/route.ts +307 -0
- package/app/api/adRequest/route.ts +568 -0
- package/app/api/analytics/[reportType]/route.ts +338 -0
- package/app/api/bio/route.ts +314 -0
- package/app/api/blog/route.ts +307 -0
- package/app/api/chat/route.ts +15 -0
- package/app/api/contact/route.ts +410 -0
- package/app/api/contacts/route.ts +225 -0
- package/app/api/files/route.ts +430 -0
- package/app/api/gallery-data/route.ts +661 -0
- package/app/api/schedule/route.ts +456 -0
- package/app/api/sync-user/route.ts +114 -0
- package/app/api/trial-request/route.ts +298 -0
- package/app/blog/[id]/page.tsx +281 -0
- package/app/blog/page.tsx +217 -0
- package/app/constants/about.ts +49 -0
- package/app/constants/adRequest.ts +114 -0
- package/app/constants/contact.ts +41 -0
- package/app/constants/faq.ts +46 -0
- package/app/constants/gallery.ts +43 -0
- package/app/constants/page.ts +70 -0
- package/app/constants/schedule.ts +72 -0
- package/app/contact/page.tsx +285 -0
- package/app/faq/page.tsx +192 -0
- package/app/favicon.ico +0 -0
- package/app/gallery/page.tsx +320 -0
- package/app/globals.css +58 -0
- package/app/layout.tsx +62 -0
- package/app/page.tsx +339 -0
- package/app/schedule/page.tsx +661 -0
- package/bin/init.js +187 -0
- package/components/addOns/functional/BioEditor.tsx +430 -0
- package/components/addOns/functional/CalendlyWidget.tsx +101 -0
- package/components/addOns/functional/ClassList.tsx +146 -0
- package/components/addOns/functional/ClassPopup.tsx +399 -0
- package/components/addOns/functional/ContactForm.tsx +285 -0
- package/components/addOns/functional/FileUploader.tsx +293 -0
- package/components/addOns/functional/ImageDescCarousel.tsx +821 -0
- package/components/addOns/functional/NewUserAnalytics.tsx +101 -0
- package/components/addOns/functional/ScheduleCarousel.tsx +172 -0
- package/components/addOns/functional/aboutSections/AboutSection.tsx +571 -0
- package/components/addOns/functional/aboutSections/constants/aboutSection.ts +66 -0
- package/components/addOns/functional/blogSections/BlogDashboard.tsx +185 -0
- package/components/addOns/functional/blogSections/BlogFormPopUp.tsx +555 -0
- package/components/addOns/functional/blogSections/BlogList.tsx +149 -0
- package/components/addOns/functional/blogSections/BlogSidebar.tsx +59 -0
- package/components/addOns/functional/blogSections/constants/blogDashboard.ts +29 -0
- package/components/addOns/functional/blogSections/constants/blogFormPopUp.ts +98 -0
- package/components/addOns/functional/blogSections/constants/blogList.ts +23 -0
- package/components/addOns/functional/blogSections/constants/blogSidebar.ts +16 -0
- package/components/addOns/functional/contactsDashboard/ContactsDashboard.tsx +348 -0
- package/components/addOns/functional/contactsDashboard/constants/contactsDashboard.ts +71 -0
- package/components/addOns/functional/galleries/GalleryComplex.tsx +908 -0
- package/components/addOns/functional/galleries/GallerySimple.tsx +604 -0
- package/components/addOns/functional/galleries/constants/galleryComplex.ts +105 -0
- package/components/addOns/functional/galleries/constants/gallerySimple.ts +75 -0
- package/components/addOns/functional/schedules/ScheduleGridOne.tsx +263 -0
- package/components/addOns/functional/schedules/ScheduleGridTwo.tsx +295 -0
- package/components/addOns/functional/schedules/ScheduleGridTwoBasic.tsx +289 -0
- package/components/addOns/functional/schedules/SchedulerForm.tsx +429 -0
- package/components/addOns/functional/schedules/constants/ScheduleGridTwo.ts +41 -0
- package/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.ts +41 -0
- package/components/addOns/functional/schedules/constants/SchedulerForm.ts +66 -0
- package/components/addOns/functional/schedules/constants/scheduleGridOne.ts +55 -0
- package/components/addOns/non-functional/AnnouncementBanner.tsx +47 -0
- package/components/addOns/non-functional/FeaturesSection.tsx +63 -0
- package/components/addOns/non-functional/HeroSection.tsx +143 -0
- package/components/addOns/non-functional/IconBubble.tsx +50 -0
- package/components/addOns/non-functional/SampleCarousel.tsx +205 -0
- package/components/addOns/non-functional/Testimonials.tsx +336 -0
- package/components/addOns/non-functional/ThreeSetGallery.tsx +64 -0
- package/components/addOns/non-functional/aboutSections/AboutSection.tsx +63 -0
- package/components/addOns/non-functional/aboutSections/constants/aboutSection.ts +25 -0
- package/components/addOns/non-functional/imageCarousels/ProductSlider.tsx +118 -0
- package/components/addOns/non-functional/imageCarousels/ProgramCarousel.tsx +233 -0
- package/components/addOns/non-functional/imageCarousels/constants/programCarousel.ts +40 -0
- package/components/addOns/non-functional/imageCarousels/constants/programSlider.ts +37 -0
- package/components/addOns/non-functional/spinner.tsx +22 -0
- package/components/footers/footer.tsx +454 -0
- package/components/navBars/navbar.tsx +311 -0
- package/components/other/accordion.tsx +58 -0
- package/components/other/admin-menu.tsx +69 -0
- package/components/other/alert-dialog.tsx +141 -0
- package/components/other/alert.tsx +59 -0
- package/components/other/aspect-ratio.tsx +7 -0
- package/components/other/avatar.tsx +50 -0
- package/components/other/badge.tsx +36 -0
- package/components/other/breadcrumb.tsx +115 -0
- package/components/other/button.tsx +733 -0
- package/components/other/calendar.tsx +66 -0
- package/components/other/card.tsx +86 -0
- package/components/other/carousel.tsx +275 -0
- package/components/other/chart.tsx +363 -0
- package/components/other/checkbox.tsx +30 -0
- package/components/other/collapsible.tsx +11 -0
- package/components/other/command.tsx +155 -0
- package/components/other/context-menu.tsx +200 -0
- package/components/other/dialog.tsx +122 -0
- package/components/other/drawer.tsx +118 -0
- package/components/other/dropdown-menu.tsx +200 -0
- package/components/other/form.tsx +179 -0
- package/components/other/hover-card.tsx +29 -0
- package/components/other/input-otp.tsx +71 -0
- package/components/other/input.tsx +25 -0
- package/components/other/label.tsx +26 -0
- package/components/other/login-popup.tsx +0 -0
- package/components/other/menubar.tsx +236 -0
- package/components/other/mobile-icon.tsx +22 -0
- package/components/other/navigation-menu.tsx +128 -0
- package/components/other/pagination.tsx +117 -0
- package/components/other/popover.tsx +31 -0
- package/components/other/progress.tsx +28 -0
- package/components/other/radio-group.tsx +44 -0
- package/components/other/resizable.tsx +45 -0
- package/components/other/scroll-area.tsx +48 -0
- package/components/other/select.tsx +160 -0
- package/components/other/separator.tsx +31 -0
- package/components/other/sheet.tsx +140 -0
- package/components/other/signup-popup.tsx +0 -0
- package/components/other/skeleton.tsx +15 -0
- package/components/other/slider.tsx +28 -0
- package/components/other/social-icons.tsx +40 -0
- package/components/other/sonner.tsx +31 -0
- package/components/other/switch.tsx +29 -0
- package/components/other/table.tsx +117 -0
- package/components/other/tabs.tsx +55 -0
- package/components/other/textarea.tsx +24 -0
- package/components/other/toast.tsx +123 -0
- package/components/other/toaster.tsx +35 -0
- package/components/other/toggle-group.tsx +61 -0
- package/components/other/toggle.tsx +45 -0
- package/components/other/tooltip.tsx +30 -0
- package/components/theme-provider.tsx +9 -0
- package/components/types.ts +22 -0
- package/dist/.next/types/app/api/about/route.js +52 -0
- package/dist/.next/types/app/api/blog/route.js +52 -0
- package/dist/.next/types/app/api/files/route.js +52 -0
- package/dist/.next/types/app/api/schedule/route.js +52 -0
- package/dist/.next/types/app/api/sync-user/route.js +52 -0
- package/dist/.next/types/app/layout.js +22 -0
- package/dist/.next/types/app/page.js +22 -0
- package/dist/app/about/page.jsx +259 -0
- package/dist/app/adRequest/page.jsx +531 -0
- package/dist/app/analytics/page.jsx +298 -0
- package/dist/app/api/about/route.js +285 -0
- package/dist/app/api/adRequest/route.js +440 -0
- package/dist/app/api/analytics/[reportType]/route.js +346 -0
- package/dist/app/api/bio/route.js +293 -0
- package/dist/app/api/blog/route.js +366 -0
- package/dist/app/api/chat/route.js +58 -0
- package/dist/app/api/contact/route.js +163 -0
- package/dist/app/api/contacts/route.js +234 -0
- package/dist/app/api/files/route.js +444 -0
- package/dist/app/api/gallery-data/route.js +642 -0
- package/dist/app/api/schedule/route.js +461 -0
- package/dist/app/api/sync-user/route.js +174 -0
- package/dist/app/api/trial-request/route.js +165 -0
- package/dist/app/blog/[id]/page.jsx +307 -0
- package/dist/app/blog/page.jsx +210 -0
- package/dist/app/constants/about.js +32 -0
- package/dist/app/constants/adRequest.js +113 -0
- package/dist/app/constants/contact.js +40 -0
- package/dist/app/constants/faq.js +36 -0
- package/dist/app/constants/gallery.js +42 -0
- package/dist/app/constants/page.js +69 -0
- package/dist/app/constants/schedule.js +71 -0
- package/dist/app/contact/page.jsx +119 -0
- package/dist/app/faq/page.jsx +97 -0
- package/dist/app/gallery/page.jsx +280 -0
- package/dist/app/layout.jsx +45 -0
- package/dist/app/page.jsx +324 -0
- package/dist/app/schedule/page.jsx +500 -0
- package/dist/components/addOns/functional/BioEditor.jsx +175 -0
- package/dist/components/addOns/functional/CalendlyWidget.jsx +61 -0
- package/dist/components/addOns/functional/ClassList.jsx +158 -0
- package/dist/components/addOns/functional/ClassPopup.jsx +300 -0
- package/dist/components/addOns/functional/ContactForm.jsx +219 -0
- package/dist/components/addOns/functional/FileUploader.jsx +222 -0
- package/dist/components/addOns/functional/ImageDescCarousel.jsx +464 -0
- package/dist/components/addOns/functional/NewUserAnalytics.jsx +71 -0
- package/dist/components/addOns/functional/ScheduleCarousel.jsx +68 -0
- package/dist/components/addOns/functional/aboutSections/AboutSection.jsx +369 -0
- package/dist/components/addOns/functional/aboutSections/constants/aboutSection.js +65 -0
- package/dist/components/addOns/functional/blogSections/BlogDashboard.jsx +111 -0
- package/dist/components/addOns/functional/blogSections/BlogFormPopUp.jsx +465 -0
- package/dist/components/addOns/functional/blogSections/BlogList.jsx +170 -0
- package/dist/components/addOns/functional/blogSections/BlogSidebar.jsx +35 -0
- package/dist/components/addOns/functional/blogSections/constants/blogDashboard.js +28 -0
- package/dist/components/addOns/functional/blogSections/constants/blogFormPopUp.js +97 -0
- package/dist/components/addOns/functional/blogSections/constants/blogList.js +22 -0
- package/dist/components/addOns/functional/blogSections/constants/blogSidebar.js +15 -0
- package/dist/components/addOns/functional/contactsDashboard/ContactsDashboard.jsx +323 -0
- package/dist/components/addOns/functional/contactsDashboard/constants/contactsDashboard.js +70 -0
- package/dist/components/addOns/functional/galleries/GalleryComplex.jsx +586 -0
- package/dist/components/addOns/functional/galleries/GallerySimple.jsx +385 -0
- package/dist/components/addOns/functional/galleries/constants/galleryComplex.js +104 -0
- package/dist/components/addOns/functional/galleries/constants/gallerySimple.js +74 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridOne.jsx +167 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridTwo.jsx +100 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridTwoBasic.jsx +97 -0
- package/dist/components/addOns/functional/schedules/SchedulerForm.jsx +188 -0
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwo.js +40 -0
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.js +40 -0
- package/dist/components/addOns/functional/schedules/constants/SchedulerForm.js +65 -0
- package/dist/components/addOns/functional/schedules/constants/scheduleGridOne.js +54 -0
- package/dist/components/addOns/non-functional/AnnouncementBanner.jsx +24 -0
- package/dist/components/addOns/non-functional/FeaturesSection.jsx +38 -0
- package/dist/components/addOns/non-functional/HeroSection.jsx +71 -0
- package/dist/components/addOns/non-functional/IconBubble.jsx +36 -0
- package/dist/components/addOns/non-functional/SampleCarousel.jsx +114 -0
- package/dist/components/addOns/non-functional/Testimonials.jsx +177 -0
- package/dist/components/addOns/non-functional/ThreeSetGallery.jsx +40 -0
- package/dist/components/addOns/non-functional/aboutSections/AboutSection.jsx +35 -0
- package/dist/components/addOns/non-functional/aboutSections/constants/aboutSection.js +24 -0
- package/dist/components/addOns/non-functional/imageCarousels/ProductSlider.jsx +80 -0
- package/dist/components/addOns/non-functional/imageCarousels/ProgramCarousel.jsx +155 -0
- package/dist/components/addOns/non-functional/imageCarousels/constants/programCarousel.js +39 -0
- package/dist/components/addOns/non-functional/imageCarousels/constants/programSlider.js +36 -0
- package/dist/components/addOns/non-functional/spinner.jsx +13 -0
- package/dist/components/footers/footer.jsx +219 -0
- package/dist/components/navBars/navbar.jsx +158 -0
- package/dist/components/other/accordion.jsx +40 -0
- package/dist/components/other/admin-menu.jsx +34 -0
- package/dist/components/other/alert-dialog.jsx +64 -0
- package/dist/components/other/alert.jsx +41 -0
- package/dist/components/other/aspect-ratio.jsx +4 -0
- package/dist/components/other/avatar.jsx +31 -0
- package/dist/components/other/badge.jsx +32 -0
- package/dist/components/other/breadcrumb.jsx +57 -0
- package/dist/components/other/button.jsx +321 -0
- package/dist/components/other/calendar.jsx +43 -0
- package/dist/components/other/card.jsx +44 -0
- package/dist/components/other/carousel.jsx +140 -0
- package/dist/components/other/chart.jsx +182 -0
- package/dist/components/other/checkbox.jsx +26 -0
- package/dist/components/other/collapsible.jsx +6 -0
- package/dist/components/other/command.jsx +68 -0
- package/dist/components/other/context-menu.jsx +88 -0
- package/dist/components/other/dialog.jsx +60 -0
- package/dist/components/other/drawer.jsx +60 -0
- package/dist/components/other/dropdown-menu.jsx +90 -0
- package/dist/components/other/form.jsx +89 -0
- package/dist/components/other/hover-card.jsx +23 -0
- package/dist/components/other/input-otp.jsx +46 -0
- package/dist/components/other/input.jsx +19 -0
- package/dist/components/other/label.jsx +23 -0
- package/dist/components/other/login-popup.jsx +1 -0
- package/dist/components/other/menubar.jsx +96 -0
- package/dist/components/other/mobile-icon.jsx +11 -0
- package/dist/components/other/navigation-menu.jsx +62 -0
- package/dist/components/other/pagination.jsx +63 -0
- package/dist/components/other/popover.jsx +25 -0
- package/dist/components/other/progress.jsx +23 -0
- package/dist/components/other/radio-group.jsx +31 -0
- package/dist/components/other/resizable.jsx +29 -0
- package/dist/components/other/scroll-area.jsx +36 -0
- package/dist/components/other/select.jsx +83 -0
- package/dist/components/other/separator.jsx +21 -0
- package/dist/components/other/sheet.jsx +74 -0
- package/dist/components/other/signup-popup.jsx +1 -0
- package/dist/components/other/skeleton.jsx +17 -0
- package/dist/components/other/slider.jsx +26 -0
- package/dist/components/other/social-icons.jsx +15 -0
- package/dist/components/other/sonner.jsx +27 -0
- package/dist/components/other/switch.jsx +23 -0
- package/dist/components/other/table.jsx +56 -0
- package/dist/components/other/tabs.jsx +32 -0
- package/dist/components/other/textarea.jsx +19 -0
- package/dist/components/other/toast.jsx +58 -0
- package/dist/components/other/toaster.jsx +31 -0
- package/dist/components/other/toggle-group.jsx +41 -0
- package/dist/components/other/toggle.jsx +39 -0
- package/dist/components/other/tooltip.jsx +24 -0
- package/dist/components/theme-provider.jsx +18 -0
- package/dist/components/types.js +1 -0
- package/dist/hooks/use-toast.js +135 -0
- package/dist/lib/auth-context.jsx +144 -0
- package/dist/lib/google-analytics.jsx +148 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/verify-user.js +142 -0
- package/dist/middleware.js +32 -0
- package/dist/tailwind.config.js +86 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/hooks/use-toast.ts +188 -0
- package/lib/auth-context.tsx +131 -0
- package/lib/google-analytics.tsx +98 -0
- package/lib/utils.ts +6 -0
- package/lib/verify-user.ts +118 -0
- package/middleware.ts +35 -0
- package/next.config.js +10 -0
- package/package.json +116 -0
- package/postcss.config.js +6 -0
- package/public/images/FitStop.png +0 -0
- package/public/images/classes/bodyblast.JPG +0 -0
- package/public/images/classes/cardioxtrain.JPG +0 -0
- package/public/images/classes/combo.JPG +0 -0
- package/public/images/classes/flexiblefriday.JPG +0 -0
- package/public/images/classes/freestyle.jpg +0 -0
- package/public/images/classes/noclasses.jpg +0 -0
- package/public/images/classes/seniorstretch.JPG +0 -0
- package/public/images/classes/stretch.JPG +0 -0
- package/public/images/classes/zoomba.JPG +0 -0
- package/public/images/fitstoproom1.jpg +0 -0
- package/public/images/fitstoproom2.jpg +0 -0
- package/public/images/gallery/021-1024x768.jpg +0 -0
- package/public/images/gallery/023-1024x768.jpg +0 -0
- package/public/images/gallery/027-1024x768.jpg +0 -0
- package/public/images/gallery/029-1024x768.jpg +0 -0
- package/public/images/gallery/030-1024x768.jpg +0 -0
- package/public/images/gallery/042-1024x768.jpg +0 -0
- package/public/images/gallery/049-1024x768.jpg +0 -0
- package/public/images/gallery/073-1024x768.jpg +0 -0
- package/public/images/gallery/108-300x225.jpg +0 -0
- package/public/images/gallery/109-300x225.jpg +0 -0
- package/public/images/gallery/116.jpg +0 -0
- package/public/images/gallery/123-1-1024x768.jpg +0 -0
- package/public/images/gallery/133.jpg +0 -0
- package/public/images/gallery/142-1.jpg +0 -0
- package/public/images/gallery/143.jpg +0 -0
- package/public/images/gallery/145-1-1024x768.jpg +0 -0
- package/public/images/gallery/151-1024x768.jpg +0 -0
- package/public/images/gallery/166-300x225.jpg +0 -0
- package/public/images/gallery/175.jpg +0 -0
- package/public/images/gallery/183-1024x768.jpg +0 -0
- package/public/images/gallery/311.JPG +0 -0
- package/public/images/gallery/413-1.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0003-1024x683.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0076-1024x683.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0171-1024x683.jpg +0 -0
- package/public/images/gallery/DSCN0233-1024x768.jpg +0 -0
- package/public/images/gallery/DSCN0245-1-1024x768.jpg +0 -0
- package/public/images/gallery/Fitstopgirls2.jpg +0 -0
- package/public/images/gallery/GrandOpening2009.JPG +0 -0
- package/public/images/gallery/IMG_1937.JPG +0 -0
- package/public/images/gallery/IMG_1950-20.jpg +0 -0
- package/public/images/gallery/IMG_2112.JPG +0 -0
- package/public/images/gallery/IMG_2229.JPG +0 -0
- package/public/images/gallery/IMG_2272.JPG +0 -0
- package/public/images/gallery/IMG_2336.JPG +0 -0
- package/public/images/gallery/IMG_2367.JPG +0 -0
- package/public/images/gallery/IMG_2520.jpg +0 -0
- package/public/images/gallery/IMG_2564.jpg +0 -0
- package/public/images/gallery/IMG_3678.jpg +0 -0
- package/public/images/gallery/IMG_3744.jpg +0 -0
- package/public/images/gallery/IMG_3745.jpg +0 -0
- package/public/images/gallery/IMG_6383.jpg +0 -0
- package/public/images/gallery/Jillian-8-Months-2338-1024x683.jpg +0 -0
- package/public/images/gallery/Kathys-Fit-Stop-0032-1024x675.jpg +0 -0
- package/public/images/gallery/LaurieinPlank.jpeg +0 -0
- package/public/images/gallery/May2017032.JPG +0 -0
- package/public/images/gallery/clubpic10.jpg +0 -0
- package/public/images/gallery/clubpic15.jpg +0 -0
- package/public/images/gallery/clubpic2.jpg +0 -0
- package/public/images/gallery/clubpic3.jpg +0 -0
- package/public/images/gallery/clubpic4.jpg +0 -0
- package/public/images/gallery/clubpic5.jpg +0 -0
- package/public/images/gallery/clubpic6.jpg +0 -0
- package/public/images/gallery/clubpic7.jpg +0 -0
- package/public/images/gallery/clubpic8.jpg +0 -0
- package/public/images/gallery/clubpic9.jpg +0 -0
- package/public/images/gallery/z014-1024x768.jpg +0 -0
- package/public/images/gallery/z019-1-1024x768.jpg +0 -0
- package/public/images/kathy_faq-300x132.jpg +0 -0
- package/public/images/kathyportrait.jpg +0 -0
- package/public/images/kristiportrait.jpg +0 -0
- package/public/images/maincoverbackground.JPG +0 -0
- package/public/images/videos/FitStopLoopVideo.mp4 +0 -0
- package/public/images/weights.jpg +0 -0
- package/public/pdf/FitStop-Forum-April-2025.pdf +0 -0
- package/tailwind.config.ts +89 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
// ImageDescCarousel.tsx
|
|
2
|
+
"use client";
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
+
function step(op) {
|
|
28
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
30
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
+
switch (op[0]) {
|
|
33
|
+
case 0: case 1: t = op; break;
|
|
34
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
+
default:
|
|
38
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
+
if (t[2]) _.ops.pop();
|
|
43
|
+
_.trys.pop(); continue;
|
|
44
|
+
}
|
|
45
|
+
op = body.call(thisArg, _);
|
|
46
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
import { useState, useEffect, useRef } from "react";
|
|
51
|
+
import { ActionButton, EditIconButton, TrashIconButton, CloseButton, SubmitButton, CancelButton, NextButton, PrevButton, FilterButton, DeleteButton, } from "@/components/other/button";
|
|
52
|
+
import { Card } from "@/components/other/card";
|
|
53
|
+
import Image from "next/image";
|
|
54
|
+
import { Upload, ChevronRight, X } from "lucide-react";
|
|
55
|
+
import { motion, useScroll, useTransform } from "framer-motion";
|
|
56
|
+
var Slideshow = function (_a) {
|
|
57
|
+
var images = _a.images, altPrefix = _a.altPrefix, currentSlide = _a.currentSlide, setCurrentSlide = _a.setCurrentSlide, isAdmin = _a.isAdmin, handleImageClick = _a.handleImageClick, handleEditImage = _a.handleEditImage, handleDeleteImage = _a.handleDeleteImage;
|
|
58
|
+
var _b = useState(false), isPaused = _b[0], setIsPaused = _b[1];
|
|
59
|
+
var slideshowRef = useRef(null);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
if (isPaused || images.length <= 1)
|
|
62
|
+
return;
|
|
63
|
+
var interval = setInterval(function () {
|
|
64
|
+
setCurrentSlide(function (prev) { return (prev + 1) % images.length; });
|
|
65
|
+
}, 5000);
|
|
66
|
+
return function () { return clearInterval(interval); };
|
|
67
|
+
}, [isPaused, images.length, setCurrentSlide]);
|
|
68
|
+
var goToPrev = function () { return setCurrentSlide(function (prev) { return (prev - 1 + images.length) % images.length; }); };
|
|
69
|
+
var goToNext = function () { return setCurrentSlide(function (prev) { return (prev + 1) % images.length; }); };
|
|
70
|
+
if (!images.length || !images[currentSlide]) {
|
|
71
|
+
return (<Card className="relative h-[40vh] min-h-[400px] sm:h-[50vh] lg:h-[600px] rounded-[1.5rem] overflow-hidden glassmorphism w-full mx-auto max-w-3xl md:max-w-none md:mx-0 flex items-center justify-center" ref={slideshowRef}>
|
|
72
|
+
<p className="text-gray-600 text-lg">No images available</p>
|
|
73
|
+
</Card>);
|
|
74
|
+
}
|
|
75
|
+
return (<div className="relative h-[40vh] min-h-[400px] sm:h-[50vh] lg:h-[600px] rounded-[1.5rem] overflow-hidden glassmorphism w-full mx-auto max-w-3xl md:max-w-none md:mx-0" ref={slideshowRef} onMouseEnter={function () { return setIsPaused(true); }} onMouseLeave={function () { return setIsPaused(false); }}>
|
|
76
|
+
<div className="relative w-full h-full cursor-pointer" onClick={function () { return handleImageClick(images[currentSlide]); }}>
|
|
77
|
+
<Image src={images[currentSlide].url} alt={images[currentSlide].title || altPrefix} fill className="object-cover rounded-[1rem] transition-transform duration-700 hover:scale-110" sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw" loading="lazy" quality={85}/>
|
|
78
|
+
<div className="absolute inset-0 bg-gradient-to-t from-black/40 to-transparent opacity-0 hover:opacity-100 transition-opacity duration-500"></div>
|
|
79
|
+
<div className="absolute bottom-4 left-4 text-white opacity-90 transition-opacity duration-500">
|
|
80
|
+
<span className="text-lg sm:text-xl lg:text-2xl font-semibold drop-shadow-md">
|
|
81
|
+
{altPrefix}
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
{isAdmin && (<div className="absolute top-2 right-2 flex space-x-2">
|
|
85
|
+
<EditIconButton onClick={function (e) {
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
handleEditImage(images[currentSlide]);
|
|
88
|
+
}}/>
|
|
89
|
+
<TrashIconButton onClick={function (e) {
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
handleDeleteImage(images[currentSlide].documentId);
|
|
92
|
+
}}/>
|
|
93
|
+
</div>)}
|
|
94
|
+
</div>
|
|
95
|
+
{images.length > 1 && (<>
|
|
96
|
+
<PrevButton size="icon" onClick={function (e) {
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
goToPrev();
|
|
99
|
+
}} className="absolute left-4 top-1/2 transform -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white rounded-full w-12 h-12 flex items-center justify-center z-0"/>
|
|
100
|
+
<NextButton size="icon" onClick={function (e) {
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
goToNext();
|
|
103
|
+
}} className="absolute right-4 top-1/2 transform -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white rounded-full w-12 h-12 flex items-center justify-center z-0">
|
|
104
|
+
<ChevronRight className="h-6 w-6"/>
|
|
105
|
+
</NextButton>
|
|
106
|
+
</>)}
|
|
107
|
+
</div>);
|
|
108
|
+
};
|
|
109
|
+
export function ImageDescCarousel(_a) {
|
|
110
|
+
var _this = this;
|
|
111
|
+
var _b;
|
|
112
|
+
var user = _a.user, uploadedImages = _a.uploadedImages, setUploadedImages = _a.setUploadedImages, error = _a.error, setError = _a.setError, isLoading = _a.isLoading, setIsLoading = _a.setIsLoading, handleImageUpload = _a.handleImageUpload, handleDeleteImage = _a.handleDeleteImage;
|
|
113
|
+
var _c = useState("indoor"), activeTab = _c[0], setActiveTab = _c[1];
|
|
114
|
+
var _d = useState(0), currentSlide = _d[0], setCurrentSlide = _d[1];
|
|
115
|
+
var _e = useState(false), isUploadModalOpen = _e[0], setIsUploadModalOpen = _e[1];
|
|
116
|
+
var _f = useState(false), isEditModalOpen = _f[0], setIsEditModalOpen = _f[1];
|
|
117
|
+
var _g = useState(false), isConfirmDeleteOpen = _g[0], setIsConfirmDeleteOpen = _g[1];
|
|
118
|
+
var _h = useState(null), documentIdToDelete = _h[0], setDocumentIdToDelete = _h[1];
|
|
119
|
+
var _j = useState(null), selectedImage = _j[0], setSelectedImage = _j[1];
|
|
120
|
+
var _k = useState({ file: null, title: "", description: "", category: "indoor" }), uploadForm = _k[0], setUploadForm = _k[1];
|
|
121
|
+
var _l = useState({ id: 0, documentId: "", title: "", description: "", category: "indoor", file: null }), editForm = _l[0], setEditForm = _l[1];
|
|
122
|
+
var _m = useState(false), isSubmitting = _m[0], setIsSubmitting = _m[1];
|
|
123
|
+
var containerRef = useRef(null);
|
|
124
|
+
var scrollYProgress = useScroll({
|
|
125
|
+
target: containerRef,
|
|
126
|
+
offset: ["start end", "end start"],
|
|
127
|
+
}).scrollYProgress;
|
|
128
|
+
var parallaxY = useTransform(scrollYProgress, [0, 1], [0, -50]);
|
|
129
|
+
var isAdmin = !!(user === null || user === void 0 ? void 0 : user.businessAdminId);
|
|
130
|
+
var filteredImages = uploadedImages.filter(function (img) { return (img.category || "none") === activeTab; });
|
|
131
|
+
var handleImageClick = function (image) {
|
|
132
|
+
setSelectedImage(image);
|
|
133
|
+
window.dispatchEvent(new CustomEvent("modalStateChange", { detail: { isOpen: true } }));
|
|
134
|
+
};
|
|
135
|
+
var handleCloseModal = function () {
|
|
136
|
+
setSelectedImage(null);
|
|
137
|
+
window.dispatchEvent(new CustomEvent("modalStateChange", { detail: { isOpen: false } }));
|
|
138
|
+
};
|
|
139
|
+
var openEditModal = function (image) {
|
|
140
|
+
var _a;
|
|
141
|
+
setEditForm({
|
|
142
|
+
id: image.id,
|
|
143
|
+
documentId: image.documentId,
|
|
144
|
+
title: ((_a = image.title) === null || _a === void 0 ? void 0 : _a.trim()) || "",
|
|
145
|
+
description: image.description || "",
|
|
146
|
+
category: image.category && image.category !== "none" ? image.category : "indoor",
|
|
147
|
+
file: null,
|
|
148
|
+
});
|
|
149
|
+
setIsEditModalOpen(true);
|
|
150
|
+
};
|
|
151
|
+
var handleCloseEditModal = function () {
|
|
152
|
+
setIsEditModalOpen(false);
|
|
153
|
+
setEditForm({ id: 0, documentId: "", title: "", description: "", category: "indoor", file: null });
|
|
154
|
+
};
|
|
155
|
+
var handleCloseUploadModal = function () {
|
|
156
|
+
setIsUploadModalOpen(false);
|
|
157
|
+
setUploadForm({ file: null, title: "", description: "", category: "indoor" });
|
|
158
|
+
};
|
|
159
|
+
var openConfirmDelete = function (documentId) {
|
|
160
|
+
setDocumentIdToDelete(documentId);
|
|
161
|
+
setIsConfirmDeleteOpen(true);
|
|
162
|
+
};
|
|
163
|
+
var handleConfirmDelete = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
164
|
+
return __generator(this, function (_a) {
|
|
165
|
+
switch (_a.label) {
|
|
166
|
+
case 0:
|
|
167
|
+
if (!(documentIdToDelete !== null)) return [3 /*break*/, 2];
|
|
168
|
+
return [4 /*yield*/, handleDeleteImage(documentIdToDelete)];
|
|
169
|
+
case 1:
|
|
170
|
+
_a.sent();
|
|
171
|
+
setIsConfirmDeleteOpen(false);
|
|
172
|
+
setDocumentIdToDelete(null);
|
|
173
|
+
_a.label = 2;
|
|
174
|
+
case 2: return [2 /*return*/];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}); };
|
|
178
|
+
var handleCancelDelete = function () {
|
|
179
|
+
setIsConfirmDeleteOpen(false);
|
|
180
|
+
setDocumentIdToDelete(null);
|
|
181
|
+
};
|
|
182
|
+
var handleEditImage = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
183
|
+
var token, imageId, formData, uploadResponse, uploadResult, payload, response, data, err_1;
|
|
184
|
+
var _a;
|
|
185
|
+
return __generator(this, function (_b) {
|
|
186
|
+
switch (_b.label) {
|
|
187
|
+
case 0:
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
if (!isAdmin) {
|
|
190
|
+
setError("Unauthorized: Only admins can edit images");
|
|
191
|
+
return [2 /*return*/];
|
|
192
|
+
}
|
|
193
|
+
_b.label = 1;
|
|
194
|
+
case 1:
|
|
195
|
+
_b.trys.push([1, 7, 8, 9]);
|
|
196
|
+
setIsLoading(true);
|
|
197
|
+
setIsSubmitting(true);
|
|
198
|
+
token = localStorage.getItem("jwt");
|
|
199
|
+
if (!token) {
|
|
200
|
+
throw new Error("Unauthorized: No token provided");
|
|
201
|
+
}
|
|
202
|
+
imageId = void 0;
|
|
203
|
+
if (!editForm.file) return [3 /*break*/, 4];
|
|
204
|
+
formData = new FormData();
|
|
205
|
+
formData.append("file", editForm.file);
|
|
206
|
+
return [4 /*yield*/, fetch("/api/gallery-data", {
|
|
207
|
+
method: "POST",
|
|
208
|
+
headers: { Authorization: "Bearer ".concat(token) },
|
|
209
|
+
credentials: "include",
|
|
210
|
+
body: formData,
|
|
211
|
+
})];
|
|
212
|
+
case 2:
|
|
213
|
+
uploadResponse = _b.sent();
|
|
214
|
+
if (!uploadResponse.ok) {
|
|
215
|
+
throw new Error("Failed to upload new image");
|
|
216
|
+
}
|
|
217
|
+
return [4 /*yield*/, uploadResponse.json()];
|
|
218
|
+
case 3:
|
|
219
|
+
uploadResult = _b.sent();
|
|
220
|
+
imageId = (_a = uploadResult.data[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
221
|
+
_b.label = 4;
|
|
222
|
+
case 4:
|
|
223
|
+
payload = __assign({ documentId: editForm.documentId, title: editForm.title, description: editForm.description, category: editForm.category }, (imageId && { image: imageId }));
|
|
224
|
+
return [4 /*yield*/, fetch("/api/gallery-data", {
|
|
225
|
+
method: "PUT",
|
|
226
|
+
headers: {
|
|
227
|
+
"Content-Type": "application/json",
|
|
228
|
+
Authorization: "Bearer ".concat(token),
|
|
229
|
+
},
|
|
230
|
+
credentials: "include",
|
|
231
|
+
body: JSON.stringify(payload),
|
|
232
|
+
})];
|
|
233
|
+
case 5:
|
|
234
|
+
response = _b.sent();
|
|
235
|
+
if (response.status === 401) {
|
|
236
|
+
setError("Session expired. Please log in again.");
|
|
237
|
+
localStorage.removeItem("jwt");
|
|
238
|
+
setUploadedImages([]);
|
|
239
|
+
return [2 /*return*/];
|
|
240
|
+
}
|
|
241
|
+
if (!response.ok) {
|
|
242
|
+
throw new Error("Failed to update image");
|
|
243
|
+
}
|
|
244
|
+
return [4 /*yield*/, response.json()];
|
|
245
|
+
case 6:
|
|
246
|
+
data = (_b.sent()).data;
|
|
247
|
+
setUploadedImages(data);
|
|
248
|
+
setIsEditModalOpen(false);
|
|
249
|
+
setEditForm({ id: 0, documentId: "", title: "", description: "", category: "indoor", file: null });
|
|
250
|
+
return [3 /*break*/, 9];
|
|
251
|
+
case 7:
|
|
252
|
+
err_1 = _b.sent();
|
|
253
|
+
setError(err_1 instanceof Error ? err_1.message : "Failed to update image");
|
|
254
|
+
return [3 /*break*/, 9];
|
|
255
|
+
case 8:
|
|
256
|
+
setIsLoading(false);
|
|
257
|
+
setIsSubmitting(false);
|
|
258
|
+
return [7 /*endfinally*/];
|
|
259
|
+
case 9: return [2 /*return*/];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}); };
|
|
263
|
+
var sectionVariants = {
|
|
264
|
+
hidden: { opacity: 0 },
|
|
265
|
+
visible: {
|
|
266
|
+
opacity: 1,
|
|
267
|
+
transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1], staggerChildren: 0.1 },
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
var modalVariants = {
|
|
271
|
+
hidden: { opacity: 0, y: "100vh" },
|
|
272
|
+
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.16, 1, 0.3, 1] } },
|
|
273
|
+
exit: { opacity: 0, y: "100vh", transition: { duration: 0.3, ease: "easeIn" } },
|
|
274
|
+
};
|
|
275
|
+
return (<div className="w-full">
|
|
276
|
+
<style jsx>{"\n :root {\n --jubilee: #F47C7C;\n --exuberant-blue: #FF69B4;\n --modern-purple: #D946EF;\n --green-primary: #1a3c34;\n }\n\n .glassmorphism {\n background: rgba(255, 255, 255, 0.08);\n backdrop-filter: blur(10px);\n border: 2px solid transparent;\n border-image: linear-gradient(45deg, var(--exuberant-blue), var(--jubilee), var(--modern-purple)) 1;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);\n }\n\n .modal-form input,\n .modal-form textarea,\n .modal-form select {\n font-size: 0.875rem;\n padding: 0.5rem;\n border-radius: 0.375rem;\n background: #374151;\n color: #f3f4f6;\n border: 1px solid #4b5563;\n }\n\n .modal-form input:focus,\n .modal-form textarea:focus,\n .modal-form select:focus {\n outline: none;\n ring: 2px solid #3b82f6;\n }\n\n .modal-form button {\n padding: 0.5rem 1rem;\n font-size: 0.875rem;\n border-radius: 0.375rem;\n }\n\n .modal-form label {\n font-size: 0.875rem;\n color: #d1d5db;\n }\n\n @supports not (backdrop-filter: blur(10px)) {\n .glassmorphism {\n background: rgba(255, 255, 255, 0.2);\n }\n }\n\n @media (max-width: 768px) {\n .glassmorphism {\n backdrop-filter: none;\n background: rgba(255, 255, 255, 0.2);\n }\n\n .modal-form input,\n .modal-form textarea,\n .modal-form select {\n font-size: 0.875rem;\n padding: 0.5rem;\n border-radius: 0.375rem;\n }\n\n .modal-form button {\n padding: 0.5rem 1rem;\n font-size: 0.875rem;\n border-radius: 0.375rem;\n }\n\n .modal-form label {\n font-size: 0.875rem;\n }\n\n .modal-form .flex {\n flex-direction: column;\n gap: 0.5rem;\n }\n\n .modal-form textarea {\n min-height: 80px;\n }\n }\n\n @media (max-width: 320px) {\n .modal-form input,\n .modal-form textarea,\n .modal-form select {\n font-size: 0.75rem;\n padding: 0.5rem;\n }\n\n .modal-form button {\n padding: 0.5rem 0.75rem;\n font-size: 0.75rem;\n }\n\n .modal-form label {\n font-size: 0.75rem;\n }\n }\n "}</style>
|
|
277
|
+
|
|
278
|
+
{/* Gallery Section */}
|
|
279
|
+
<motion.section variants={sectionVariants} initial="hidden" whileInView="visible" viewport={{ once: true }} className="relative py-12 sm:py-16 lg:pb-24 w-full bg-gray-50/50 backdrop-blur-sm">
|
|
280
|
+
<div className="relative z-10 w-full px-4 sm:px-6 lg:px-8">
|
|
281
|
+
{error && <p className="text-red-600 text-lg text-center mb-8">{error}</p>}
|
|
282
|
+
{user && !isAdmin && (<p className="text-yellow-600 text-lg text-center mb-8">
|
|
283
|
+
You are logged in but do not have admin privileges.
|
|
284
|
+
</p>)}
|
|
285
|
+
{isAdmin && (<div className="flex justify-center mb-12">
|
|
286
|
+
<ActionButton onClick={function () { return setIsUploadModalOpen(true); }} className="flex items-center">
|
|
287
|
+
<Upload className="mr-2 h-4 w-4"/>
|
|
288
|
+
Upload New Image
|
|
289
|
+
</ActionButton>
|
|
290
|
+
</div>)}
|
|
291
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 sm:gap-8 lg:gap-12 items-start">
|
|
292
|
+
<div className="h-auto min-h-[600px] glassmorphism p-6 sm:p-8 lg:p-10 rounded-[1.5rem] flex flex-col space-y-4 sm:space-y-6 order-2 max-w-3xl mx-auto md:max-w-none md:mx-0 md:order-1">
|
|
293
|
+
<h2 className="text-2xl sm:text-3xl lg:text-4xl font-extrabold text-gray-900">
|
|
294
|
+
{((_b = filteredImages[currentSlide]) === null || _b === void 0 ? void 0 : _b.title) || "Image Gallery"}
|
|
295
|
+
</h2>
|
|
296
|
+
<div className="text-sm sm:text-base lg:text-lg text-gray-700">
|
|
297
|
+
{filteredImages.length > 0 && currentSlide >= 0 && currentSlide < filteredImages.length ? ((filteredImages[currentSlide].description || "")
|
|
298
|
+
.split("\n")
|
|
299
|
+
.filter(function (paragraph) { return paragraph.trim() !== ""; })
|
|
300
|
+
.map(function (paragraph, index) { return (<p key={index} className="mb-4">
|
|
301
|
+
{paragraph}
|
|
302
|
+
</p>); }) || <p className="mb-4">No description available.</p>) : (<p className="mb-4">No description available.</p>)}
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
<div className="order-1 md:order-2">
|
|
306
|
+
<Slideshow images={filteredImages} altPrefix="Image Gallery" currentSlide={currentSlide} setCurrentSlide={setCurrentSlide} isAdmin={isAdmin} handleImageClick={handleImageClick} handleEditImage={openEditModal} handleDeleteImage={openConfirmDelete}/>
|
|
307
|
+
<div className="flex flex-wrap justify-center gap-2 sm:gap-4 mt-6 z-20">
|
|
308
|
+
{["indoor", "outdoor", "commercial"].map(function (tab) { return (<FilterButton key={tab} isActive={activeTab === tab} onClick={function () {
|
|
309
|
+
setActiveTab(tab);
|
|
310
|
+
setCurrentSlide(0);
|
|
311
|
+
}}>
|
|
312
|
+
{tab.charAt(0).toUpperCase() + tab.slice(1)}
|
|
313
|
+
</FilterButton>); })}
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</motion.section>
|
|
319
|
+
|
|
320
|
+
{/* Upload Modal */}
|
|
321
|
+
{isAdmin && isUploadModalOpen && (<motion.div variants={modalVariants} initial="hidden" animate="visible" exit="exit" className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate" onClick={handleCloseUploadModal} aria-modal="true" role="dialog">
|
|
322
|
+
<div className="relative max-w-5xl w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg max-h-[90vh] overflow-y-auto" onClick={function (e) { return e.stopPropagation(); }}>
|
|
323
|
+
<CloseButton onClick={handleCloseUploadModal}>
|
|
324
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
325
|
+
</CloseButton>
|
|
326
|
+
|
|
327
|
+
<h3 className="text-xl font-bold text-white mb-4">Upload Image</h3>
|
|
328
|
+
<form onSubmit={function (e) {
|
|
329
|
+
setIsSubmitting(true);
|
|
330
|
+
handleImageUpload(e, uploadForm.file, uploadForm.title, uploadForm.description, uploadForm.category).then(function () {
|
|
331
|
+
handleCloseUploadModal();
|
|
332
|
+
setIsSubmitting(false);
|
|
333
|
+
});
|
|
334
|
+
}} className="space-y-4 modal-form">
|
|
335
|
+
<div>
|
|
336
|
+
<label htmlFor="image-upload" className="block text-sm font-medium text-gray-300 mb-1">
|
|
337
|
+
Choose Image
|
|
338
|
+
</label>
|
|
339
|
+
<input type="file" accept="image/jpeg,image/png,image/gif" onChange={function (e) { var _a; return setUploadForm(__assign(__assign({}, uploadForm), { file: ((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) || null })); }} className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm" id="image-upload"/>
|
|
340
|
+
{uploadForm.file && (<p className="mt-2 text-gray-300 text-sm">Selected: {uploadForm.file.name}</p>)}
|
|
341
|
+
</div>
|
|
342
|
+
<div>
|
|
343
|
+
<label htmlFor="image-title" className="block text-sm font-medium text-gray-300 mb-1">
|
|
344
|
+
Image Title (optional)
|
|
345
|
+
</label>
|
|
346
|
+
<input id="image-title" value={uploadForm.title} onChange={function (e) { return setUploadForm(__assign(__assign({}, uploadForm), { title: e.target.value })); }} placeholder="Enter image title" className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"/>
|
|
347
|
+
</div>
|
|
348
|
+
<div>
|
|
349
|
+
<label htmlFor="image-description" className="block text-sm font-medium text-gray-300 mb-1">
|
|
350
|
+
Image Description (optional)
|
|
351
|
+
</label>
|
|
352
|
+
<textarea id="image-description" value={uploadForm.description} onChange={function (e) { return setUploadForm(__assign(__assign({}, uploadForm), { description: e.target.value })); }} placeholder="Enter image description" className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm min-h-[80px]"/>
|
|
353
|
+
</div>
|
|
354
|
+
<div>
|
|
355
|
+
<label htmlFor="image-category" className="block text-sm font-medium text-gray-300 mb-1">
|
|
356
|
+
Category
|
|
357
|
+
</label>
|
|
358
|
+
<select id="image-category" value={uploadForm.category} onChange={function (e) {
|
|
359
|
+
return setUploadForm(__assign(__assign({}, uploadForm), { category: e.target.value }));
|
|
360
|
+
}} className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm">
|
|
361
|
+
<option value="indoor">Indoor</option>
|
|
362
|
+
<option value="outdoor">Outdoor</option>
|
|
363
|
+
<option value="commercial">Commercial</option>
|
|
364
|
+
</select>
|
|
365
|
+
</div>
|
|
366
|
+
<div className="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-3">
|
|
367
|
+
<SubmitButton type="submit" disabled={isSubmitting || !uploadForm.file}>
|
|
368
|
+
{isSubmitting ? "Uploading..." : "Upload"}
|
|
369
|
+
</SubmitButton>
|
|
370
|
+
<CancelButton onClick={handleCloseUploadModal}/>
|
|
371
|
+
</div>
|
|
372
|
+
{error && <p className="text-red-400 text-sm font-medium">{error}</p>}
|
|
373
|
+
</form>
|
|
374
|
+
</div>
|
|
375
|
+
</motion.div>)}
|
|
376
|
+
|
|
377
|
+
{/* Edit Modal */}
|
|
378
|
+
{isAdmin && isEditModalOpen && (<motion.div variants={modalVariants} initial="hidden" animate="visible" exit="exit" className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate" onClick={handleCloseEditModal} aria-modal="true" role="dialog">
|
|
379
|
+
<div className="relative max-w-5xl w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg max-h-[90vh] overflow-y-auto" onClick={function (e) { return e.stopPropagation(); }}>
|
|
380
|
+
<CloseButton onClick={handleCloseEditModal}>
|
|
381
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
382
|
+
</CloseButton>
|
|
383
|
+
<h3 className="text-xl font-bold text-white mb-4">Edit Image</h3>
|
|
384
|
+
<form onSubmit={handleEditImage} className="space-y-4 modal-form">
|
|
385
|
+
<div>
|
|
386
|
+
<label htmlFor="edit-image" className="block text-sm font-medium text-gray-300 mb-1">
|
|
387
|
+
Replace Image (optional)
|
|
388
|
+
</label>
|
|
389
|
+
<input id="edit-image" type="file" accept="image/jpeg,image/png,image/gif" onChange={function (e) { var _a; return setEditForm(__assign(__assign({}, editForm), { file: ((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) || null })); }} className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"/>
|
|
390
|
+
{editForm.file && (<p className="mt-2 text-gray-300 text-sm">Selected: {editForm.file.name}</p>)}
|
|
391
|
+
</div>
|
|
392
|
+
<div>
|
|
393
|
+
<label htmlFor="edit-title" className="block text-sm font-medium text-gray-300 mb-1">
|
|
394
|
+
Image Title (optional)
|
|
395
|
+
</label>
|
|
396
|
+
<input id="edit-title" value={editForm.title} onChange={function (e) { return setEditForm(__assign(__assign({}, editForm), { title: e.target.value })); }} placeholder="Enter image title" className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"/>
|
|
397
|
+
</div>
|
|
398
|
+
<div>
|
|
399
|
+
<label htmlFor="edit-description" className="block text-sm font-medium text-gray-300 mb-1">
|
|
400
|
+
Image Description (optional)
|
|
401
|
+
</label>
|
|
402
|
+
<textarea id="edit-description" value={editForm.description} onChange={function (e) { return setEditForm(__assign(__assign({}, editForm), { description: e.target.value })); }} placeholder="Enter image description" className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm min-h-[80px]"/>
|
|
403
|
+
</div>
|
|
404
|
+
<div>
|
|
405
|
+
<label htmlFor="edit-category" className="block text-sm font-medium text-gray-300 mb-1">
|
|
406
|
+
Category
|
|
407
|
+
</label>
|
|
408
|
+
<select id="edit-category" value={editForm.category} onChange={function (e) {
|
|
409
|
+
return setEditForm(__assign(__assign({}, editForm), { category: e.target.value }));
|
|
410
|
+
}} className="w-full p-2 rounded bg-gray-700 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm">
|
|
411
|
+
<option value="indoor">Indoor</option>
|
|
412
|
+
<option value="outdoor">Outdoor</option>
|
|
413
|
+
<option value="commercial">Commercial</option>
|
|
414
|
+
</select>
|
|
415
|
+
</div>
|
|
416
|
+
<div className="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-3">
|
|
417
|
+
<SubmitButton type="submit" disabled={isSubmitting}>
|
|
418
|
+
{isSubmitting ? "Saving..." : "Save"}
|
|
419
|
+
</SubmitButton>
|
|
420
|
+
<CancelButton onClick={handleCloseEditModal}/>
|
|
421
|
+
</div>
|
|
422
|
+
{error && <p className="text-red-400 text-sm font-medium">{error}</p>}
|
|
423
|
+
</form>
|
|
424
|
+
</div>
|
|
425
|
+
</motion.div>)}
|
|
426
|
+
|
|
427
|
+
{/* Delete Confirmation Modal */}
|
|
428
|
+
{isAdmin && isConfirmDeleteOpen && (<motion.div variants={modalVariants} initial="hidden" animate="visible" exit="exit" className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10000] p-4 isolate" onClick={handleCancelDelete} aria-modal="true" role="dialog">
|
|
429
|
+
<div className="relative max-w-sm w-full mx-4 p-6 bg-gray-800/50 border border-gray-700/50 rounded-lg shadow-lg max-h-[90vh] overflow-y-auto" onClick={function (e) { return e.stopPropagation(); }}>
|
|
430
|
+
<CloseButton onClick={handleCancelDelete}>
|
|
431
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
432
|
+
</CloseButton>
|
|
433
|
+
<h3 className="text-xl font-bold text-white mb-4">Confirm Deletion</h3>
|
|
434
|
+
<p className="text-gray-300 mb-6">Are you sure you want to delete this image?</p>
|
|
435
|
+
<div className="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-3">
|
|
436
|
+
<DeleteButton onClick={handleConfirmDelete} disabled={isSubmitting}>
|
|
437
|
+
{isSubmitting ? "Deleting..." : "Delete"}
|
|
438
|
+
</DeleteButton>
|
|
439
|
+
<CancelButton onClick={handleCancelDelete}/>
|
|
440
|
+
</div>
|
|
441
|
+
</div>
|
|
442
|
+
</motion.div>)}
|
|
443
|
+
|
|
444
|
+
{/* View Image Modal */}
|
|
445
|
+
{selectedImage && (<motion.div variants={modalVariants} initial="hidden" animate="visible" exit="exit" className="fixed inset-0 bg-black/90 flex items-center justify-center z-[10001] p-2 sm:p-4 isolate" onClick={handleCloseModal} role="dialog" aria-modal="true" aria-labelledby="modal-image">
|
|
446
|
+
<div className="relative max-w-5xl w-full mx-2 sm:mx-4 max-h-[90vh] bg-gray-800/50 border border-gray-700/50 rounded-2xl shadow-lg overflow-hidden" onClick={function (e) { return e.stopPropagation(); }}>
|
|
447
|
+
<CloseButton variant="close-form" onClick={handleCloseModal}>
|
|
448
|
+
<X className="h-6 w-6 sm:h-8 sm:w-8"/>
|
|
449
|
+
</CloseButton>
|
|
450
|
+
<div className="relative w-full h-[70vh] sm:h-[80vh]">
|
|
451
|
+
<Image src={selectedImage.url} alt={selectedImage.title || "Gallery image"} fill className="object-contain rounded-2xl" quality={85}/>
|
|
452
|
+
{(selectedImage.title || selectedImage.description) && (<div className="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-3 sm:p-4">
|
|
453
|
+
{selectedImage.title && (<h3 className="text-lg sm:text-xl md:text-2xl font-bold text-white drop-shadow-lg">
|
|
454
|
+
{selectedImage.title}
|
|
455
|
+
</h3>)}
|
|
456
|
+
{selectedImage.description && (<p className="text-xs sm:text-sm md:text-base text-gray-200 drop-shadow-md line-clamp-2">
|
|
457
|
+
{selectedImage.description}
|
|
458
|
+
</p>)}
|
|
459
|
+
</div>)}
|
|
460
|
+
</div>
|
|
461
|
+
</div>
|
|
462
|
+
</motion.div>)}
|
|
463
|
+
</div>);
|
|
464
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// components/ui/new-users-chart.tsx
|
|
2
|
+
"use client";
|
|
3
|
+
import { Line } from "react-chartjs-2";
|
|
4
|
+
import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend } from "chart.js";
|
|
5
|
+
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend);
|
|
6
|
+
var formatMonth = function (date) {
|
|
7
|
+
var year = date.slice(0, 4);
|
|
8
|
+
var month = parseInt(date.slice(4, 6), 10);
|
|
9
|
+
return new Date(parseInt(year), month - 1).toLocaleDateString("en-US", { month: "short", year: "numeric" });
|
|
10
|
+
};
|
|
11
|
+
export function NewUsersChart(_a) {
|
|
12
|
+
var data = _a.data, currentYear = _a.currentYear;
|
|
13
|
+
var chartData = {
|
|
14
|
+
labels: data.map(function (row) { return formatMonth(row.date); }),
|
|
15
|
+
datasets: [
|
|
16
|
+
{
|
|
17
|
+
label: "New Users",
|
|
18
|
+
data: data.map(function (row) { return row.newUsers; }),
|
|
19
|
+
borderColor: "#34D399",
|
|
20
|
+
backgroundColor: "rgba(52, 211, 153, 0.5)",
|
|
21
|
+
tension: 0.1,
|
|
22
|
+
pointRadius: 3,
|
|
23
|
+
borderWidth: 2,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
var chartOptions = {
|
|
28
|
+
responsive: true,
|
|
29
|
+
maintainAspectRatio: false,
|
|
30
|
+
plugins: {
|
|
31
|
+
legend: {
|
|
32
|
+
position: "top",
|
|
33
|
+
labels: {
|
|
34
|
+
color: "#9CA3AF",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
display: false,
|
|
39
|
+
},
|
|
40
|
+
tooltip: {
|
|
41
|
+
backgroundColor: "#1F2937",
|
|
42
|
+
titleColor: "#E5E7EB",
|
|
43
|
+
bodyColor: "#E5E7EB",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
scales: {
|
|
47
|
+
x: {
|
|
48
|
+
grid: {
|
|
49
|
+
display: false,
|
|
50
|
+
},
|
|
51
|
+
ticks: {
|
|
52
|
+
color: "#9CA3AF",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
y: {
|
|
56
|
+
grid: {
|
|
57
|
+
color: "rgba(255, 255, 255, 0.1)",
|
|
58
|
+
},
|
|
59
|
+
ticks: {
|
|
60
|
+
color: "#9CA3AF",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
return (<section className="bg-gray-800/50 backdrop-blur-md rounded-2xl shadow-lg p-6 border border-gray-700/50 hover:border-blue-500/50 transition-colors">
|
|
66
|
+
<h2 className="text-2xl font-bold text-blue-200 mb-6">New Users by Month ({currentYear})</h2>
|
|
67
|
+
{data.length === 0 ? (<p className="text-gray-400 text-center py-4">No data available</p>) : (<div className="h-[300px]">
|
|
68
|
+
<Line data={chartData} options={chartOptions}/>
|
|
69
|
+
</div>)}
|
|
70
|
+
</section>);
|
|
71
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Card } from "@/components/other/card";
|
|
4
|
+
export function ScheduleCarousel(_a) {
|
|
5
|
+
var weeklySchedule = _a.weeklySchedule, backgroundImages = _a.backgroundImages, error = _a.error;
|
|
6
|
+
var _b = useState(0), currentDayIndex = _b[0], setCurrentDayIndex = _b[1];
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
backgroundImages.forEach(function (image) {
|
|
9
|
+
var img = new Image();
|
|
10
|
+
img.src = image;
|
|
11
|
+
});
|
|
12
|
+
var days = Object.keys(weeklySchedule);
|
|
13
|
+
var interval = setInterval(function () {
|
|
14
|
+
setCurrentDayIndex(function (prev) { return (prev === days.length - 1 ? 0 : prev + 1); });
|
|
15
|
+
}, 5000);
|
|
16
|
+
return function () { return clearInterval(interval); };
|
|
17
|
+
}, [weeklySchedule, backgroundImages]);
|
|
18
|
+
return (<div className="w-full bg-black z-0">
|
|
19
|
+
<section className="w-full py-16 sm:py-24 px-4 sm:px-8 relative">
|
|
20
|
+
<style jsx>{"\n .schedule-background {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-size: cover;\n background-position: center;\n transition: opacity 0.5s ease-in-out;\n opacity: 0;\n }\n\n .schedule-background.active {\n opacity: 1;\n }\n\n .schedule-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.3);\n z-index: 1;\n }\n "}</style>
|
|
21
|
+
|
|
22
|
+
<div className="absolute inset-0 z-0 w-full h-full">
|
|
23
|
+
{backgroundImages.map(function (image, index) { return (<div key={index} className={"schedule-background ".concat(index === currentDayIndex ? "active" : "")} style={{ backgroundImage: "url(".concat(image, ")") }}/>); })}
|
|
24
|
+
<div className="schedule-overlay"/>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div className="relative z-10 h-[600px] sm:h-[800px] overflow-hidden">
|
|
28
|
+
{error ? (<div className="text-center !text-white text-4xl sm:text-5xl font-semibold h-full flex items-center justify-center max-w-full" style={{ textShadow: "2px 2px 4px rgba(0, 0, 0, 0.5)" }}>
|
|
29
|
+
{error}
|
|
30
|
+
</div>) : ((function () {
|
|
31
|
+
var days = Object.entries(weeklySchedule);
|
|
32
|
+
var _a = days[currentDayIndex], day = _a[0], classes = _a[1];
|
|
33
|
+
return (<Card className="w-full max-w-full p-6 sm:p-10 md:p-16 flex flex-col items-center justify-center h-full overflow-hidden bg-transparent border-none">
|
|
34
|
+
<h3 className="text-5xl sm:text-6xl md:text-8xl font-bold text-white text-center tracking-tight" style={{
|
|
35
|
+
textShadow: "\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000,\n 0 2px 4px rgba(0, 0, 0, 0.4)\n ",
|
|
36
|
+
fontSize: "clamp(2.5rem, 10vw, 5rem)",
|
|
37
|
+
}}>
|
|
38
|
+
{day}
|
|
39
|
+
</h3>
|
|
40
|
+
|
|
41
|
+
<ul className="space-y-6 font-semibold text-center mt-8 max-w-full">
|
|
42
|
+
{classes.length > 0 ? (classes.map(function (cls) { return (<li key={"".concat(cls.startTime, "-").concat(cls.endTime)} className="text-2xl sm:text-3xl md:text-4xl text-white break-words" style={{
|
|
43
|
+
textShadow: "\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000,\n 0 2px 4px rgba(0, 0, 0, 0.4),\n 2px 2px 10px rgba(0, 0, 0, 0.6)\n ",
|
|
44
|
+
fontSize: "clamp(1.5rem, 6vw, 2.5rem)",
|
|
45
|
+
}}>
|
|
46
|
+
<span className="font-semibold text-[#FF69B4]">{cls.name}</span> -{" "}
|
|
47
|
+
{new Date("2023-01-01 ".concat(cls.startTime)).toLocaleTimeString("en-US", {
|
|
48
|
+
hour: "numeric",
|
|
49
|
+
minute: "2-digit",
|
|
50
|
+
})}{" "}
|
|
51
|
+
to{" "}
|
|
52
|
+
{new Date("2023-01-01 ".concat(cls.endTime)).toLocaleTimeString("en-US", {
|
|
53
|
+
hour: "numeric",
|
|
54
|
+
minute: "2-digit",
|
|
55
|
+
})}
|
|
56
|
+
</li>); })) : (<li className="text-2xl sm:text-3xl md:text-4xl text-white font-semibold" style={{
|
|
57
|
+
textShadow: "\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000,\n 0 2px 4px rgba(0, 0, 0, 0.4),\n 2px 2px 10px rgba(0, 0, 0, 0.6)\n ",
|
|
58
|
+
fontSize: "clamp(1.5rem, 6vw, 2.5rem)",
|
|
59
|
+
}}>
|
|
60
|
+
No classes
|
|
61
|
+
</li>)}
|
|
62
|
+
</ul>
|
|
63
|
+
</Card>);
|
|
64
|
+
})())}
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
</div>);
|
|
68
|
+
}
|