import{r as u,b as x,p as h,ad as g,ae as P,af as f,j as s,F as D,ag as S,ah as m,ai as v,D as E}from"./index-n-59FgrC.js";import{E as T}from"./useTaskTypesData-CgG6u01U.js";import{s as p,S as k,u as y,T as A}from"./useSprintDnd-CJDVVJPx.js";import{A as i}from"./Accordion-DVbX6gPb.js";const F=u.memo(({sprint:e,tasks:a,isError:r,isLoading:l,isMyTasks:n})=>{const{t:o}=x(),{data:t}=h.useFetchProjectsQuery({States:P(),ReturnDataType:g.ProjectReturnDataType.Projects}),c=f((t==null?void 0:t.Projects)||[]).folderEntities[e.rootProjectId];return s.jsx(i,{chevronPosition:"left",variant:"separated",defaultValue:"sprint",classNames:{item:p.item},children:s.jsxs(i.Item,{value:"sprint",children:[s.jsx(i.Control,{children:s.jsxs(D,{align:"center",children:[s.jsx(S,{children:e.Name}),s.jsx(m,{className:p.sumBadge,variant:"transparent",radius:"lg",children:o("createTask.taskCount",{count:v(a)})}),n&&c&&s.jsx(m,{maw:200,variant:"light",size:"xs",children:c.Name})]})}),s.jsx(i.Panel,{styles:{content:{paddingLeft:12.5}},children:s.jsx(k,{tasks:a,sprint:e,isError:r,isLoading:l,isMyTasks:n})})]})})}),b=({sprints:e,groupedBySprint:a,isError:r,isLoading:l,error:n,isMyTasks:o})=>{const{handleDragMove:t,handleDragEnd:j,sensors:c}=y({isMyTasks:o});return r?s.jsx(T,{error:n}):s.jsxs(E,{onDragMove:t,onDragEnd:j,sensors:c,children:[e.map(d=>s.jsx(F,{sprint:d,tasks:a[d.Id],isError:r,isLoading:l,isMyTasks:o},d.Id)),s.jsx(A,{})]})};export{b as S};
