Skip to content

Commit

Permalink
broke out faqitem to own component
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustPaulsrud committed Sep 5, 2024
1 parent ed35ba7 commit 9edca9f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/app/exhibitor/packages/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { StatusModuleItem } from "@/app/exhibitor/_components/StatusModuleItem"
import { Page } from "@/components/shared/Page"
import { fetchDates } from "@/components/shared/hooks/api/useDates"
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger
} from "@/components/ui/accordion"
import { Accordion } from "@/components/ui/accordion"
import { Button } from "@/components/ui/button"
import { FAQItem } from "@/components/ui/faqitem"
import { formatDate } from "@/lib/utils"
import { Metadata } from "next"
import Link from "next/link"
Expand All @@ -18,25 +14,6 @@ export const metadata: Metadata = {
"The packages we offer for exhibitors at Armada. Choose between bronze, silver and gold."
}

function FAQItem({
children,
title
}: {
children: React.ReactNode
title: string
}) {
return (
<AccordionItem value={title} className="border-none">
<AccordionTrigger className="mb-0 w-full rounded px-2 py-4 text-left font-normal transition hover:bg-slate-700 hover:no-underline">
<h3 className="text-xl">{title}</h3>
</AccordionTrigger>
<AccordionContent className="mt-0 p-2 pt-0 text-base text-stone-400">
{children}
</AccordionContent>
</AccordionItem>
)
}

export default async function Packages() {
const dates = await fetchDates()

Expand Down
25 changes: 25 additions & 0 deletions src/components/ui/faqitem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
AccordionContent,
AccordionItem,
AccordionTrigger
} from "@/components/ui/accordion"
import * as React from "react"

export function FAQItem({
children,
title
}: {
children: React.ReactNode
title: string
}) {
return (
<AccordionItem value={title} className="border-none">
<AccordionTrigger className="mb-0 w-full rounded px-2 py-4 text-left font-normal transition hover:bg-slate-700 hover:no-underline">
<h3 className="text-xl">{title}</h3>
</AccordionTrigger>
<AccordionContent className="mt-0 p-2 pt-0 text-base text-stone-400">
{children}
</AccordionContent>
</AccordionItem>
)
}

0 comments on commit 9edca9f

Please sign in to comment.