text: (this.webpackJsonpsleepwell=this.webpackJsonpsleepwell||[]).push([[166],{1379:function(e,t,c){"use strict";c.r(t);var n=c(638),s=c(1),a=c(637),j=c(647),l=c(18),r=c(13),b=c(640).default;t.default=function(){var e=Object(j.e)({mode:"all"}),t=(e.control,e.handleSubmit,e.formState.errors,Object(l.g)()),c=Object(s.useState)(null),i=Object(n.a)(c,2),o=i[0],u=i[1],h=Object(s.useState)(!1),d=Object(n.a)(h,2),O=d[0],x=d[1],m=Object(s.useState)(""),p=Object(n.a)(m,2),g=p[0],f=p[1],v=Object(s.useState)(""),S=Object(n.a)(v,2),C=(S[0],S[1]),T=Object(s.useState)(""),w=Object(n.a)(T,2),y=w[0],I=w[1],F=Object(s.useState)(""),N=Object(n.a)(F,2),k=N[0],B=N[1],J=Object(s.useState)(""),K=Object(n.a)(J,2),D=K[0],Q=K[1];return Object(r.jsx)("div",{children:Object(r.jsx)(a.ub,{children:Object(r.jsx)(a.u,{xs:"12",sm:"12",children:Object(r.jsxs)(a.j,{children:[Object(r.jsx)(a.n,{children:"Add Grid"}),Object(r.jsx)(a.k,{children:Object(r.jsxs)(a.J,{encType:"multipart/form-data",onSubmit:function(e){e.preventDefault(),u(null),x(!0);var c=new FormData;b.post("/banner/",c,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){x(!1),t.push("/banners-manaement/banners")})).catch((function(e){x(!1),e.response.data.errorMessage?u(e.response.data.errorMessage):u("Something went wrong!")}))},children:[Object(r.jsx)("br",{}),o&&Object(r.jsx)("p",{className:"text-danger",children:o}),Object(r.jsxs)(a.ub,{children:[Object(r.jsx)(a.u,{xl:"6",children:Object(r.jsxs)(a.K,{children:[Object(r.jsx)(a.ab,{htmlFor:"shortItem",children:"Title"}),Object(r.jsx)(a.T,{className:"mb-3",children:Object(r.jsx)(a.Q,{type:"text",onChange:function(e){f(e.target.value)},value:g,placeholder:"Title",autoComplete:"title"})})]})}),Object(r.jsxs)(a.u,{xs:"6",children:[Object(r.jsx)(a.ab,{htmlFor:"category",children:"Image"}),Object(r.jsxs)(a.T,{className:"mb-3",children:[Object(r.jsx)(a.ab,{htmlFor:"cardOneImage",variant:"custom-file",children:"Choose Image..."}),Object(r.jsx)(a.S,{onChange:function(e){C(e.target.files[0])},custom:!0,id:"cardOneImage",type:"file"})]})]})]}),Object(r.jsxs)(a.ub,{children:[Object(r.jsx)(a.u,{xl:"6",children:Object(r.jsxs)(a.K,{children:[Object(r.jsx)(a.ab,{htmlFor:"shortItem",children:"Button text"}),Object(r.jsx)(a.T,{className:"mb-3",children:Object(r.jsx)(a.Q,{type:"text",onChange:function(e){B(e.target.value)},value:k,placeholder:"Button text",autoComplete:"Button text"})})]})}),Object(r.jsx)(a.u,{xl:"6",children:Object(r.jsxs)(a.K,{children:[Object(r.jsx)(a.ab,{htmlFor:"shortItem",children:"Button link"}),Object(r.jsx)(a.T,{className:"mb-3",children:Object(r.jsx)(a.Q,{type:"text",onChange:function(e){Q(e.target.value)},value:D,placeholder:"Button link",autoComplete:"Button link"})})]})})]}),Object(r.jsx)(a.ub,{children:Object(r.jsx)(a.u,{xl:"12",children:Object(r.jsxs)(a.K,{children:[Object(r.jsx)(a.ab,{htmlFor:"shortItem",children:"Description"}),Object(r.jsx)(a.T,{className:"mb-3",children:Object(r.jsx)(a.Jb,{id:"content",rows:"3",onChange:function(e){I(e.target.value)},value:y})})]})})}),Object(r.jsx)(a.ub,{children:Object(r.jsx)(a.u,{xs:"8",children:Object(r.jsx)("button",{className:"btn btn-success",disabled:!!O,type:"submit",children:O?"Loading...":"Add Content"})})})]})})]})})})})}}}]);
  //# sourceMappingURL=166.4b23f55f.chunk.js.map