1(this["webpackJsonpvuexy-react-admin-dashboard"]=this["webpackJsonpvuexy-react-admin-dashboard"]||[]).push([[84],{1183:function(e,t,n){"use strict";n.r(t),n.d(t,"ADMIN",(function(){return C}));var a=n(8),c=n(0),s=(n(20),n(82),n(1119)),o=n(68),i=n.n(o),l=n(55),r=n.n(l),d=n(57),j=(n(85),n(368),n(1190)),u=n(1128),b=n(1129),p=n(1130),h=n(1124),m=n(1131),O=n(52),x=n(59),f=n.n(x),g=(n(77),n(74)),v=n.n(g),k=n(60),N=n.n(k),y=n(3),D=N()(f.a),w=function(e){var t=e.toggle,n=e.isOpen,s=new Date,o=new Date;o.setDate(s.getDate()-1);var i=Object(c.useState)([o,s]),l=Object(a.a)(i,2),x=l[0],f=l[1],g=Object(c.useState)(!1),k=Object(a.a)(g,2),N=k[0],w=(k[1],Object(c.useState)(null)),S=Object(a.a)(w,2),C=S[0],z=S[1],J=Object(c.useState)(!1),F=Object(a.a)(J,2),H=F[0],T=F[1];return Object(y.jsxs)(j.a,{isOpen:n,toggle:t,children:[Object(y.jsx)(u.a,{toggle:t,children:"Dodaj sezonu"}),Object(y.jsxs)(b.a,{children:[Object(y.jsx)("div",{style:{height:"50px"}}),Object(y.jsx)(p.a,{placeholder:"Naziv",theme:d.d,className:"react-select",classNamePrefix:"select",invalid:""===C&&N,value:C,onChange:function(e){z(e.target.value)}}),Object(y.jsx)("div",{style:{height:"50px"}}),Object(y.jsx)("span",{children:"Trajanje sezone"}),Object(y.jsx)(v.a,{id:"range-picker",className:"form-control",value:x,onChange:function(e){f(e)},options:{mode:"range"}}),Object(y.jsx)(h.a,{style:{marginTop:"30px"},className:"mb-1",md:"6",sm:"12",children:Object(y.jsxs)("span",{style:{margin:"30px"},className:"text-center justify-content-center",children:["Is active",Object(y.jsx)(p.a,{style:{width:"15px",height:"15px",marginLeft:"15px"},id:"basic-cb-checked",type:"checkbox",theme:d.d,checked:H,onChange:function(){T(!H)}})]})})]}),Object(y.jsx)(m.a,{children:Object(y.jsxs)("div",{className:"row justify-content-center text-center",style:{width:"100%"},children:[Object(y.jsx)("div",{className:"col",children:Object(y.jsx)(O.a.Ripple,{onClick:function(){e.toggle()},type:"submit",color:"danger",className:"btn-next",children:Object(y.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Odustani"})})}),Object(y.jsx)("div",{className:"col",children:Object(y.jsx)(O.a.Ripple,{onClick:function(){r.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/admin/add-season"),{name:C,startDate:x[0].toJSON().slice(0,10),endDate:x[1].toJSON().slice(0,10),isActive:H}).then((function(e){D.fire({icon:"success",title:"Uspje\u0161no",text:"Sezona uspje\u0161no kreirana.",customClass:{confirmButton:"btn btn-success"}})})).catch((function(e){console.log(e),D.fire({icon:"warning",title:"Pogre\u0161ka",text:"Ne\u0161to je po\u0161lo po krivu. Molimo probajte ponovno",customClass:{confirmButton:"btn btn-success"}})})),e.fetchFreshData(),t()},type:"submit",color:"primary",className:"btn-next",children:Object(y.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Dodaj"})})})]})})]})},S=(N()(f.a),n(72)),C="admin";t.default=function(){var e=Object(c.useState)(!1),t=Object(a.a)(e,2),n=t[0],o=t[1],l=Object(c.useState)([]),d=Object(a.a)(l,2),j=d[0],u=d[1],b=function(){var e="".concat("https://unisport-backend-prod.herokuapp.com","/admin/seasons");r.a.get(e).then((function(e){u(e.data.seasons)}));"".concat("https://unisport-backend-prod.herokuapp.com","/admin/sequences?season=2022/2023")};Object(c.useEffect)((function(){0==j.length&&b()}));var p=[{name:"Naziv",cell:function(e){return Object(y.jsx)("span",{children:e})}}];return Object(y.jsxs)(c.Fragment,{children:[Object(y.jsx)(w,{toggle:function(){o(!n)},fetchFreshData:b,isOpen:n}),Object(y.jsx)("div",{style:{minWidth:"90%",overflow:scroll},className:"app-user-list",children:Object(y.jsx)(s.a,{style:{overflowY:"scroll"},children:Object(y.jsx)(i.a,{noHeader:!0,subHeader:!0,responsive:!0,columns:p,className:"react-dataTable",data:j,subHeaderComponent:Object(y.jsx)(S.a,{name:"Sezone",new:"Dodaj novu sezonu",onClick:function(){o(!0)}})})})})]})}}}]); 2//# sourceMappingURL=84.87b4c132.chunk.js.map
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.