From b8cb0d8bde03850bdb15e936ab2c56aa4dc5c5ad Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Tue, 23 Jun 2026 08:47:41 +0000 Subject: [PATCH] Deploy --- .../sections/StorePoliciesSection.tsx | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/components/sections/StorePoliciesSection.tsx diff --git a/src/components/sections/StorePoliciesSection.tsx b/src/components/sections/StorePoliciesSection.tsx new file mode 100644 index 0000000..8e2793d --- /dev/null +++ b/src/components/sections/StorePoliciesSection.tsx @@ -0,0 +1,64 @@ +'use client' + +import { useState } from "react" +import { useEmDashContent } from "@/hooks/useEmDashContent" +import { ChevronDown, ChevronUp } from 'lucide-react' +import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/Card" + +export default function StorePoliciesSection() { + const { items, loading } = useEmDashContent("policies") + const [openIndex, setOpenIndex] = useState(null) + + if (loading) { + return ( +
+
+
+ ) + } + + if (items.length === 0) return null + + const toggle = (index: number) => { + setOpenIndex(openIndex === index ? null : index) + } + + return ( +
+
+

Store Policies

+
+ {items.map((item, index) => { + const d = item.data as { title?: string; body?: string } + const isOpen = openIndex === index + return ( + + toggle(index)} + > + {d.title || "Policy"} + {isOpen ? ( + + ) : ( + + )} + + {isOpen && ( + +

{d.body || "Details coming soon."}

+
+ )} +
+ ) + })} +
+
+
+ ) +}