import React, { forwardRef, HTMLAttributes, useState } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import { CAccordionContext } from './CAccordionContext'
export interface CAccordionProps extends HTMLAttributes {
/**
* The active item key.
*/
activeItemKey?: number | string
/**
* Make accordion items stay open when another item is opened
*/
alwaysOpen?: boolean
/**
* A string of all className you want applied to the base component.
*/
className?: string
/**
* Removes the default background-color, some borders, and some rounded corners to render accordions edge-to-edge with their parent container.
*/
flush?: boolean
}
export const CAccordion = forwardRef(
({ children, activeItemKey, alwaysOpen = false, className, flush, ...rest }, ref) => {
const [_activeItemKey, setActiveKey] = useState(activeItemKey)
return (
{children}
)
}
)
CAccordion.propTypes = {
activeItemKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
alwaysOpen: PropTypes.bool,
children: PropTypes.node,
className: PropTypes.string,
flush: PropTypes.bool,
}
CAccordion.displayName = 'CAccordion'