mirror of
https://github.com/vercel/commerce.git
synced 2025-08-06 08:51:25 +00:00
.github
.vscode
app
components
breadcrumb
cart
filters
form
grid
home-page
icons
layout
manufacturers-grid
orders
page
accordion-block-item.tsx
accordion-block.tsx
category-preview.tsx
icon-with-text-block.tsx
image-display.tsx
image-with-text-block.tsx
layout.ts
page-content.tsx
rich-text-display.tsx
text-block.tsx
product
profile
ui
banner.tsx
button.tsx
display-tabs.tsx
divider.tsx
faq.tsx
hero-icon.tsx
hero.tsx
loading-dots.tsx
logo-square.tsx
opengraph-image.tsx
price.tsx
prose.tsx
side-dialog.tsx
spinner.tsx
tag.tsx
tooltip.tsx
contexts
fonts
hooks
lib
public
.env.example
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
README.md
license.md
middleware.ts
next.config.js
package.json
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
32 lines
947 B
TypeScript
32 lines
947 B
TypeScript
'use client';
|
|
|
|
import { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/react';
|
|
import { ChevronRightIcon } from '@heroicons/react/24/outline';
|
|
import { ReactNode } from 'react';
|
|
|
|
const AccordionBlockItem = ({
|
|
title,
|
|
children,
|
|
defaultOpen
|
|
}: {
|
|
title: string;
|
|
children: ReactNode;
|
|
defaultOpen?: boolean;
|
|
}) => {
|
|
return (
|
|
<Disclosure defaultOpen={defaultOpen} as="div" className="pt-6">
|
|
<dt>
|
|
<DisclosureButton className="group flex w-full items-start justify-between text-left text-gray-900">
|
|
<span className="text-lg font-medium text-blue-800">{title}</span>
|
|
<ChevronRightIcon className="size-5 group-data-[open]:rotate-90 group-data-[open]:text-primary" />
|
|
</DisclosureButton>
|
|
</dt>
|
|
<DisclosurePanel as="dd" className="mt-2 flex flex-col gap-4 py-4">
|
|
{children}
|
|
</DisclosurePanel>
|
|
</Disclosure>
|
|
);
|
|
};
|
|
|
|
export default AccordionBlockItem;
|