diff --git a/src/components/blocks/AccordionBlock.tsx b/src/components/blocks/AccordionBlock.tsx
new file mode 100644
index 0000000..c7e6a49
--- /dev/null
+++ b/src/components/blocks/AccordionBlock.tsx
@@ -0,0 +1,89 @@
+import React from 'react'
+import type { Template } from 'tinacms'
+import { Accordion } from '@mantine/core'
+import { PageBlocksAccordionblock } from '~tina/__generated__/types'
+import { Icon as Iconify } from '@iconify/react'
+
+export const AccordionBlock = ({ data }: { data: PageBlocksAccordionblock }) => {
+ const [activeIndexes, setActiveIndexes] = React.useState
([])
+
+ const toggleIndex = (index: number) => {
+ setActiveIndexes((prev) => (prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]))
+ }
+
+ return (
+
+
+
{data.blockTitle}
+
+ {data.content?.map((item, index) => {
+ return item ? (
+
+
+ ) : (
+
+ )
+ }
+ onClick={() => toggleIndex(index)}
+ >
+ {item.accordionTitle}
+
+ {item.accordionContent}
+
+ ) : null
+ })}
+
+
+
+ )
+}
+
+export const AccordionContainer = ({ data }: { data: PageBlocksAccordionblock }) => {
+ return
+}
+
+export const accordionTemplate: Template = {
+ name: 'accordionblock',
+ label: 'Accordion Block',
+ fields: [
+ {
+ name: 'blockTitle',
+ type: 'string',
+ label: 'Block title',
+ },
+ {
+ name: 'content',
+ type: 'object',
+ label: 'Accordion items',
+ list: true,
+ ui: {
+ itemProps: (item: { accordionTitle: string }) => ({
+ key: item.accordionTitle,
+ label: item.accordionTitle,
+ }),
+ defaultItem: {
+ accordionTitle: 'Accordion Title',
+ accordionContent: 'Accordion Content',
+ },
+ },
+ fields: [
+ {
+ name: 'accordionTitle',
+ type: 'string',
+ label: 'Title',
+ },
+ {
+ name: 'accordionContent',
+ type: 'string',
+ label: 'Content',
+ ui: {
+ component: 'textarea',
+ },
+ },
+ ],
+ },
+ ],
+}
diff --git a/tina/config.ts b/tina/config.ts
index b502949..e85e521 100644
--- a/tina/config.ts
+++ b/tina/config.ts
@@ -10,6 +10,7 @@ import { titleImageGridTemplate } from '../src/components/blocks/layout/TitleIma
import { headerTemplate } from '../src/components/blocks/layout/Header'
import { twoColumnTemplate } from '../src/components/blocks/layout/TwoColumn'
import { richTextTemplate } from '../src/components/blocks/layout/RichText'
+import { accordionTemplate } from '../src/components/blocks/AccordionBlock'
import { heroTemplate } from '../src/components/blocks/layout/Hero'
const isLocal = process.env.TINA_PUBLIC_IS_LOCAL === 'true'
@@ -89,6 +90,7 @@ export default defineConfig({
headerTemplate,
twoColumnTemplate,
richTextTemplate,
+ accordionTemplate,
heroTemplate,
],
},