From 2c66025842e20e61afcf07af106317f348454a2d Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 15 Jun 2026 05:17:39 -0400 Subject: [PATCH] x --- .../components/page-builder/AccordionForm.tsx | 140 ++ .../page-builder/AnnouncementBarForm.tsx | 123 ++ .../components/page-builder/BannerForm.tsx | 89 ++ .../page-builder/CategoriesForm.tsx | 81 ++ .../page-builder/ContactFormForm.tsx | 40 + .../page-builder/ContactInfoForm.tsx | 80 ++ .../page-builder/EditorialCarouselForm.tsx | 186 +++ .../page-builder/EditorialTileForm.tsx | 139 ++ .../src/components/page-builder/HeroForm.tsx | 105 ++ .../page-builder/NewsletterForm.tsx | 92 ++ .../components/page-builder/ProductsForm.tsx | 171 +++ .../src/components/page-builder/TextForm.tsx | 62 + apps/admin/src/pages/PageBuilderPage.tsx | 1156 ++--------------- 13 files changed, 1421 insertions(+), 1043 deletions(-) create mode 100644 apps/admin/src/components/page-builder/AccordionForm.tsx create mode 100644 apps/admin/src/components/page-builder/AnnouncementBarForm.tsx create mode 100644 apps/admin/src/components/page-builder/BannerForm.tsx create mode 100644 apps/admin/src/components/page-builder/CategoriesForm.tsx create mode 100644 apps/admin/src/components/page-builder/ContactFormForm.tsx create mode 100644 apps/admin/src/components/page-builder/ContactInfoForm.tsx create mode 100644 apps/admin/src/components/page-builder/EditorialCarouselForm.tsx create mode 100644 apps/admin/src/components/page-builder/EditorialTileForm.tsx create mode 100644 apps/admin/src/components/page-builder/HeroForm.tsx create mode 100644 apps/admin/src/components/page-builder/NewsletterForm.tsx create mode 100644 apps/admin/src/components/page-builder/ProductsForm.tsx create mode 100644 apps/admin/src/components/page-builder/TextForm.tsx diff --git a/apps/admin/src/components/page-builder/AccordionForm.tsx b/apps/admin/src/components/page-builder/AccordionForm.tsx new file mode 100644 index 0000000..4954849 --- /dev/null +++ b/apps/admin/src/components/page-builder/AccordionForm.tsx @@ -0,0 +1,140 @@ +import React from 'react'; +import { Plus, Trash2 } from 'lucide-react'; +import { type PageSection } from '@homaroma/types'; + +interface AccordionFormProps { + editingSection: Partial; + setEditingSection: React.Dispatch | null>>; + editingLang: string; + getLocalizedValue: (payload: any, field: string) => string; + updateLocalizedValue: (field: string, value: string) => void; + getLocalizedAccordionValue: (item: any, field: string) => string; + updateAccordionCategory: (catIdx: number, field: string, value: string) => void; + updateAccordionQuestion: (catIdx: number, qIdx: number, field: string, value: string) => void; +} + +export default function AccordionForm({ + editingSection, + setEditingSection, + getLocalizedValue, + updateLocalizedValue, + getLocalizedAccordionValue, + updateAccordionCategory, + updateAccordionQuestion, +}: AccordionFormProps) { + return ( +
+
+ + updateLocalizedValue('title', e.target.value)} + className="admin-input w-full" + /> +
+ +
+
+ + +
+ + {(editingSection.payload?.categories || []).map((cat: any, cIdx: number) => ( +
+
+ updateAccordionCategory(cIdx, 'icon', e.target.value)} + className="admin-input w-16 text-center text-xl" + placeholder="Emoji" + /> + updateAccordionCategory(cIdx, 'name', e.target.value)} + className="admin-input flex-1" + placeholder="Category Name" + /> + +
+ +
+ {(cat.questions || []).map((q: any, qIdx: number) => ( +
+
+
+
+ + updateAccordionQuestion(cIdx, qIdx, 'q', e.target.value)} + className="admin-input w-full text-xs" + placeholder="What is..." + /> +
+
+ +