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