(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3400],{62999:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/[user_id]/media",function(){return t(58333)}])},58333:function(e,s,t){"use strict";t.r(s),t.d(s,{MediaContext:function(){return M},__N_SSP:function(){return _},default:function(){return v}});var a=t(828),n=t(85893),i=t(67294),r=t(54858),d=t(424),l=t(25472),o=t(97946),c=t(17244),u=t(45449);function x(e){var s,t=i.useContext(M),a=t.media,r=t.setTargetMedia,x=t.user,m=t.folders,j=t.staticHost;return(0,n.jsxs)(i.Fragment,{children:[(0,n.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,n.jsxs)("div",{className:"w-full justify-between flex-wrap",children:[(0,n.jsx)("h1",{className:"text-3xl m-0",children:"Media"}),(0,n.jsxs)(u.Z,{children:[(0,n.jsxs)("button",{className:"flex items-center gap-2",onClick:function(e){(0,l.Mw)("choose-media-type-popoup")},children:[(0,n.jsx)("span",{className:"symbol",children:"+"}),(0,n.jsx)("span",{children:"Add Media"})]}),(0,n.jsxs)("button",{className:"flex items-center gap-2 outlined gray",onClick:function(e){(0,l.Mw)("add-folder-popoup")},children:[(0,n.jsx)("span",{className:"symbol",children:"+"}),(0,n.jsx)("span",{children:"Add Folder"})]})]})]}),(0,n.jsx)(d.Z,{user:x})]}),(null===x||void 0===x||null===(s=x.verification_status)||void 0===s?void 0:s.toString().match(/1/))?(0,n.jsxs)(i.Fragment,{children:[(0,n.jsx)(c.Z,{media:a,setTargetMedia:r,folders:m,staticHost:j,user:x}),a&&a[0]&&(0,n.jsxs)("a",{className:"border-dotted border-slate-400 border-2 px-4 py-3 w-full rounded flex items-center hover:border-primary/50 gap-2 cursor-pointer justify-center",onClick:function(e){(0,l.Mw)("choose-media-type-popoup")},children:[(0,n.jsx)("span",{className:"symbol",children:"+"}),(0,n.jsx)("span",{className:"",children:"Add Media"})]})]}):(0,n.jsx)(o.Z,{})]})}var m=t(73770),j=t(94891),p=t(1347),f=t(81597),h=t(98916),w=t(62588),N=t(95264),g=t(37525),Z={},_=!0,M=i.createContext(Z);function v(e){var s=e.user,t=e.media,d=e.folders,l=e.staticHost,o=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("title",{children:"User Dashboard | Datasquirel"}),(0,n.jsx)("meta",{name:"description",content:"Welcome to your data app"})]}),c=(0,a.Z)(i.useState(null),2),u=c[0],Z=c[1],_=(0,a.Z)(i.useState(null),2),v=_[0],b=_[1],y=(0,a.Z)(i.useState(null),2),C=y[0],F=y[1],S=(0,a.Z)(i.useState(!1),2),k=S[0],T=S[1],E=(0,a.Z)(i.useState(null),2),H=E[0],P=E[1];return(0,n.jsx)(r.Z,{head:o,user:s,children:(0,n.jsxs)(M.Provider,{value:{user:s,media:t,targetMedia:H,setTargetMedia:P,folders:d,staticHost:l},children:[k&&(0,n.jsx)(N.Z,{screen:!0,title:"Processing Files ..."}),(0,n.jsx)(x,{}),(0,n.jsx)(m.Z,{setNewMedia:Z,setLoading:T}),(0,n.jsx)(h.Z,{setNewFile:b,setLoading:T}),(0,n.jsx)(g.Z,{setNewVideo:F,setLoading:T}),(0,n.jsx)(j.Z,{newMedia:u,setNewMedia:Z,newFile:v,setNewFile:b,newVideo:C,setNewVideo:F}),(0,n.jsx)(p.Z,{targetMedia:H,setTargetMedia:P,staticHost:l,media:t}),(0,n.jsx)(f.Z,{}),(0,n.jsx)(w.Z,{user:s})]})})}}},function(e){e.O(0,[9365,4156,9774,2888,179],(function(){return s=62999,e(e.s=s);var s}));var s=e.O();_N_E=s}]);