'use client'; import { VscChevronDown } from '@react-icons/all-files/vsc/VscChevronDown'; import { Disclosure, DisclosureContent, useDisclosureState } from 'ariakit/disclosure'; import type { PropsWithChildren } from 'react'; export interface SectionOptions { readonly background?: boolean | undefined; readonly buttonClassName?: string; readonly className?: string; readonly defaultClosed?: boolean | undefined; readonly gutter?: boolean | undefined; readonly icon?: JSX.Element | undefined; readonly padded?: boolean | undefined; readonly title: string; } export function Section({ title, icon, padded = false, defaultClosed = false, background = false, gutter = false, children, className = '', buttonClassName = '', }: PropsWithChildren) { const disclosure = useDisclosureState({ defaultOpen: !defaultClosed }); return (
{icon ?? null} {title}
{padded ?
{children}
: children}
); }