import{X as j,r as i,j as r,A as m}from"./app-C7YxHmQz.js";import{L as C}from"./layout-BmghzvRH.js";import{S}from"./SearchBar-DnIfIAds.js";import G from"./DataTable-BB7qMvf3.js";import{P as _}from"./Pagination-D1nhmnWD.js";import{C as l}from"./card-B5AdkNGv.js";import{ModalCreateOrEdit as E}from"./ModalCreateOrEdit-CLSbxsrC.js";import{B as N}from"./button-CJ9RiI_R.js";import{u as v}from"./useGradoStore-DNXbWJ5U.js";import{ModalDeleteGrado as M}from"./ModalDelete-DB-HSPb4.js";import{C as O}from"./circle-plus-7Ca7BNQt.js";import"./Dropdown-Bg5wGf8-.js";import"./transition-BNr4eNro.js";import"./ModeToggle-BCfRgZ6p.js";import"./index-CCZex4bU.js";import"./index-Cp62Blk_.js";import"./index-Djfxw5dv.js";import"./index-BvfrUVYs.js";import"./createLucideIcon-CBwNTxoJ.js";import"./utils-DjqsqOe8.js";import"./chevron-right-DHVrRgbL.js";import"./input-BY0xThFe.js";import"./index-w2AxdR7H.js";import"./x-Dr1RcXTX.js";import"./index-rT265Z_w.js";import"./select-mU9SGeCM.js";import"./validations-CdsIOtZM.js";import"./table-BLh168x8.js";import"./pencil-DqDwtGog.js";import"./trash-2-Bi_KTzX2.js";import"./alert-dialog-S-fo0VnI.js";import"./label-tf5I4axp.js";import"./react-3TENqYnz.js";function mr(){const{auth:d,grados:e,filters:s}=j().props,[t,n]=i.useState(s.search||""),[o,c]=i.useState(s.per_page||10),{setGrado:x,openModalCreateOrEditGrado:g,openModalDeleteGrado:u,setOpenModalCreateOrEditGrado:h}=v(),f=a=>{const p=Number(a);c(p),m.get(route("grados.index"),{search:t,per_page:p})},P=a=>{n(a),m.get(route("grados.index"),{search:a,perPage:o},{preserveState:!0})};return r.jsxs(C,{user:d.user,header:"Grado Escolar",children:[r.jsxs("div",{className:"w-full max-w-4xl",children:[r.jsxs(l,{className:"pt-4 px-4 flex gap-4",children:[r.jsx(S,{keyName:"Grado Escolar",className:"flex-1",search:t,perPage:o,onSearch:P,onPerPageChange:f}),r.jsxs(N,{onClick:()=>{h(!0),x(void 0)},children:["Crear ",r.jsx(O,{})]})]}),r.jsxs(l,{className:"mt-8 px-4 pb-4",children:[r.jsx(G,{data:e.data}),r.jsx(_,{currentPage:e.current_page,lastPage:e.last_page,prevPageUrl:e.prev_page_url,nextPageUrl:e.next_page_url,search:t,perPage:o})]})]}),g&&r.jsx(E,{}),u&&r.jsx(M,{})]})}export{mr as default};
