text: (this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{148:function(e,t,n){},149:function(e,t,n){},241:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n.n(a),r=n(28),i=n.n(r),o=(n(147),n(148),n(149),n(107)),s=n(103),u=n.n(s),l=n(128),d=n(106),f=n(139),b=n(247),j=n(246),p=n(43),h=n(245),v=n(129),x=n.n(v),O=n(248),g=n(130);function m(){return console.log("endpoint_differenciate => ","production"),window.location.origin+"/"}var y=n.n(g).a.create({baseURL:m()}),w=n(30),k=function(){var e=Object(a.useState)(!1),t=Object(d.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)([]),i=Object(d.a)(r,2),s=i[0],v=i[1],g=[{title:"#",dataIndex:"id",key:"id"},{title:"URL",dataIndex:"url",key:"url",render:function(e){return Object(w.jsx)("a",{href:e,children:e})}},{title:"Created on",dataIndex:"createdAt",key:"createdAt",render:function(e){return x()(e).format("DD-MM-YYYY hh:mm a")}}],k=function(){var e=Object(l.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,y.get("videos");case 4:t=e.sent,v(t.data),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),f.b.error("Something went wrong while fetching data!");case 11:c(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();Object(a.useEffect)((function(){k()}),[]);var C={name:"file",action:"".concat(m(),"videos/upload"),beforeUpload:function(e){var t="video"===e.type.split("/")[0];t||f.b.error("You can only upload video file!");var n=e.size/1024/1024<50;return n||f.b.error("Video must smaller than 50MB!"),t&&n}};return Object(w.jsxs)(b.a,{children:[Object(w.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:Object(w.jsx)(j.a,Object(o.a)(Object(o.a)({maxCount:1,accept:"video/*",onChange:function(e){c(!0),"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?(f.b.success("".concat(e.file.name," file uploaded successfully")),k()):"error"===e.file.status&&f.b.error("".concat(e.file.name," file upload failed.")),c(!1)}},C),{},{children:Object(w.jsx)(p.a,{icon:Object(w.jsx)(O.a,{}),children:"Click to Upload"})}))}),Object(w.jsx)(h.a,{loading:n,dataSource:s,columns:g,rowKey:function(e){return e.id}})]})};var C=function(){return Object(w.jsx)(k,{})},I=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,249)).then((function(t){var n=t.getCLS,a=t.getFID,c=t.getFCP,r=t.getLCP,i=t.getTTFB;n(e),a(e),c(e),r(e),i(e)}))};i.a.render(Object(w.jsx)(c.a.StrictMode,{children:Object(w.jsx)(C,{})}),document.getElementById("root")),I()}},[[241,1,2]]]);
  //# sourceMappingURL=main.b7fd85b9.chunk.js.map