import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import cn from "classnames";
import React from "react";
import { Wrapper as Accordion, ItemWrapper, ItemTitle as Title, ItemContent as Content, ItemIcon, } from "./styled";
import Icons from "../icons";
const AccordionItem = ({ title, content, children, titleStyle }) => {
    const [openItem, setOpenItem] = React.useState(false);
    return (_jsxs(ItemWrapper, { className: "acc-item-wrapper", children: [_jsxs(Title, { style: titleStyle, className: "acc-item-title", onClick: () => setOpenItem(!openItem), children: [title, _jsx(ItemIcon, { className: cn("acc-item-icon", { "acc-item-icon__open": openItem }), open: openItem, children: _jsx(Icons.Arrow, {}) })] }), _jsx(Content, { className: cn("acc-item-content", {
                    "acc-item-content__open": openItem,
                }), open: openItem, children: content ?? children })] }));
};
export default Object.assign(Accordion, {
    Item: AccordionItem,
});
//# sourceMappingURL=index.js.map