import{r,j as c}from"./index-f9c70843.js";function m({children:l,isFolder:d=!0}){const e=r.useRef(null),n=r.useRef(null),[u,v]=r.useState(0);return r.useEffect(()=>{const t=()=>{e.current&&v(e.current.clientWidth)};return window.addEventListener("resize",t),t(),()=>window.removeEventListener("resize",t)},[]),r.useEffect(()=>{const t=()=>{if(!e.current||!n.current)return;const{scrollLeft:o,scrollWidth:i,clientWidth:a}=e.current,x=o===0,E=o===i-a,f=i>a;n.current.classList.toggle("fade-left",f&&!x),n.current.classList.toggle("fade-right",f&&!E)},s=e.current;if(s)return s.addEventListener("scroll",t),s.dispatchEvent(new Event("scroll")),()=>s.removeEventListener("scroll",t)},[u,l]),d?c.jsx("div",{className:"hidden w-full flex-col gap-2 lg:flex",children:l}):c.jsx("div",{ref:n,className:"fade-container flex",children:c.jsx("div",{ref:e,className:"scroll-container flex gap-2",children:l})})}export{m as H};
