1import{a as p,j as t,k as A}from"./vendor-mui-B3bBnIQX.js";import{u as h}from"./useTopbar-DdNCAeWW.js";import{Q as x,E,K as F,p as S,B as j,L as D}from"./index-K18uQlJT.js";import{f as R,t as T}from"./vendor-state-3ufgB8Gu.js";import{o as C}from"./learningApi-BGuVOQTb.js";import{P as I,u as b,L as v,a as P,b as f}from"./LearningRecordModals-PZmO48_4.js";import"./vendor-router-DjW2o810.js";import"./vendor-forms-BOKXSlZG.js";import"./Pagination-C01aUWwe.js";import"./Avatar-B_NjdpbM.js";import"./dateFormat-gOhHwZfI.js";import"./Label-BBxSpPWg.js";import"./SearchableSelect-bG3ORqDE.js";import"./AppDatePicker-itKlj75y.js";import"./FilterMultiSelect-DmN76988.js";import"./FilterSectionLabel-kT9oe6wH.js";import"./TabBar-DZ0KrmyC.js";import"./Badge-CsR-r87v.js";import"./splitCodeAndName-CpMznoqV.js";import"./FormField-DFqD4YvP.js";import"./FileUpload-BsGqyxix.js";import"./useZodForm-0VxvzzsK.js";import"./index-DkRrzCW6.js";import"./AddEditMultiSelect-DpF1iQy_.js";const k=({page:r=1,filters:e={},enabled:a=!0}={})=>R({queryKey:[...x.LEARNING.ALL,r,e],queryFn:()=>C({pageNumber:r,pageSize:I,startDate:e.startDate??"",endDate:e.endDate??"",year:null,quarterId:null,goalTypes:e.learningType?.length>0?e.learningType:[],statusTeam:e.learningStatus?.length>0?e.learningStatus.map(Number):[],employeeId:e.employeeIds?.length===1?e.employeeIds[0]:"",empStatus:e.employeeStatus??[]}),enabled:a,select:s=>({records:s?.data?.records??[],totalCount:s?.data?.count??0}),placeholderData:T}),m={employeeIds:[],employeeStatus:[],learningStatus:[],employeeType:[],learningType:[],startDate:"",endDate:""},oe=()=>{const{isAdmin:r}=E(),[e,a]=p.useState(1),[s,i]=p.useState(m),[g,l]=p.useState(!1),o=b({isAdmin:r}),c=Object.values(s).some(n=>Array.isArray(n)?n.length>0:n!==""),{data:d,isLoading:y,isFetching:u,isError:L}=k({filters:s,page:e});return h({title:"Learning",subtitle:"Track every employeeâs courses and learning progress",searchPlaceholder:!1,bottomRow:t.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[t.jsx(F,{active:c,onClick:()=>l(!0),onReset:()=>{i(m),a(1)},icon:t.jsx(S,{icon:A,size:"sm"}),size:"sm"}),t.jsx(j,{variant:"primary",size:"sm",onClick:()=>o.setFormRecord(void 0),children:"+ Add Learning"})]}),topRight:null,deps:[c]}),t.jsxs(t.Fragment,{children:[u&&t.jsx(D,{}),t.jsx(v,{records:d?.records,isLoading:y,isFetching:u,isError:L,page:e,totalCount:d?.totalCount,onPageChange:a,onEdit:o.sharedHandlers.onEdit,onView:o.sharedHandlers.onView,onDelete:o.sharedHandlers.onDelete,onCopy:o.copyHandler.onCopy}),t.jsx(P,{variant:"all",open:g,onClose:()=>l(!1),initialFilters:s,onApply:n=>{i(n),a(1),l(!1)},onReset:()=>{i(m),a(1)}}),t.jsx(f,{actions:o,isAdmin:r,activeTab:"all",canAction:!0})]})};export{oe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.