import{u as g,a as S,j as r,P as f,b as h,r as D,S as P,D as k,o as E}from"./index-DTC0Ed21.js";import{E as I}from"./tasks-ClycqzjK.js";import{u as v,S as C,T as F}from"./useSprintDnd-Bl1igyj5.js";import{N as T,u as N,S as y,a as L,b as M,c as b}from"./useSprintPage-Cgkrvgqy.js";import"./useDnd-BDrl7hC3.js";import"./tasks-R9G1-k7v.js";import"./use-resize-observer-B2T5TxF-.js";import"./useTaskTypesData-DEDxUwkB.js";import"./TasksSearchInput-CjnnmYfA.js";import"./index-Ckr8pn3D.js";import"./IconChevronLeft-DwnMQlxZ.js";import"./modifiers.esm-C4X3-xc2.js";import"./IconUser-Bh9n--nN.js";import"./IconGripVertical-A4WphpSm.js";import"./useTasksData-Vq9uamq9.js";const Y=()=>{const t=g(),{project:s,isFetching:e}=S(t==null?void 0:t.ProjectId);return e?r.jsx(f,{h:"calc(100vh - 81px)"}):!t||!s?r.jsx(T,{}):r.jsx(h,{projectId:s.Id,children:r.jsx(A,{sprintData:t,projectData:s})})},A=t=>{const{sprintData:s,search:e,setSearch:a,error:n,performerIds:p,handleAssign:o,isFetching:c,isError:i,isLoading:d,groupedBySprint:m,withFilters:l}=N(t),{handleDragMove:j,handleDragEnd:x,sensors:u}=v({});return D.useEffect(()=>{a("")},[s.Id]),i?r.jsx(I,{error:n}):r.jsxs(r.Fragment,{children:[r.jsx(y,{sprint:s}),r.jsxs(P,{gap:"lg",flex:1,children:[r.jsx(L,{sprintData:s,search:e,setSearch:a,performerIds:p,setPerformerIds:o,loading:c}),r.jsxs(k,{onDragMove:j,onDragEnd:x,sensors:u,children:[r.jsx(C,{sprint:s,isError:i,isLoading:d,tasks:m[s.Id],emptyState:l?r.jsx(M,{onClick:()=>{o([]),a("")}}):r.jsx(b,{onClick:()=>E({defaultValues:{sprint:s}})})}),r.jsx(F,{})]})]})]})};export{Y as default};
