"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("react"),I=require("../../src/components/Accordion/accordion.module.css"),S=require("./components/AccordionItem/AccordionItem.cjs.js"),m=({items:s,mode:c="multiple"})=>{const[r,i]=l.useState(null),[u,a]=l.useState(new Set),g=e=>{c==="single"?i(t=>t===e?null:e):a(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},p=e=>c==="single"?r===e:u.has(e);return o.jsx("div",{className:I.container,children:s.map((e,t)=>o.jsx(S.AccordionItem,{title:e.title,content:e.content,isOpen:p(t),index:t,onClick:g,icon:e.icon,isLast:t===s.length-1},t))})};exports.Accordion=m;
