(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9326],{54299:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/[user_id]/media",function(){return t(26636)}])},26636:(e,s,t)=>{"use strict";t.r(s),t.d(s,{MediaContext:()=>g,__N_SSP:()=>_,default:()=>A});var a=t(74848),i=t(96540),l=t(51187),r=t(4709),n=t(45165),d=t(55624),o=t(53301),c=t(60557);function u(e){var s;let{media:t,setTargetMedia:l,user:u,folders:x,staticHost:j}=i.useContext(g);return(0,a.jsxs)(i.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,a.jsxs)("div",{className:"w-full justify-between flex-wrap",children:[(0,a.jsx)("h1",{className:"text-3xl m-0",children:"Media"}),(0,a.jsxs)(c.A,{children:[(0,a.jsxs)("button",{className:"flex items-center gap-2",onClick:e=>{(0,n.PB)("choose-media-type-popoup")},children:[(0,a.jsx)("span",{className:"symbol",children:"+"}),(0,a.jsx)("span",{children:"Add Media"})]}),(0,a.jsxs)("button",{className:"flex items-center gap-2 outlined gray",onClick:e=>{(0,n.PB)("add-folder-popoup")},children:[(0,a.jsx)("span",{className:"symbol",children:"+"}),(0,a.jsx)("span",{children:"Add Folder"})]})]})]}),(0,a.jsx)(r.A,{user:u})]}),(null==u?void 0:null===(s=u.verification_status)||void 0===s?void 0:s.toString().match(/1/))?(0,a.jsxs)(i.Fragment,{children:[(0,a.jsx)(o.A,{media:t,setTargetMedia:l,folders:x,staticHost:j,user:u}),t&&t[0]&&(0,a.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:e=>{(0,n.PB)("choose-media-type-popoup")},children:[(0,a.jsx)("span",{className:"symbol",children:"+"}),(0,a.jsx)("span",{className:"",children:"Add Media"})]})]}):(0,a.jsx)(d.A,{})]})}var x=t(67764),j=t(45332),p=t(84003),m=t(5531),h=t(11493),N=t(65001),w=t(620),f=t(22154),_=!0;let g=i.createContext({});function A(e){let{user:s,media:t,folders:r,staticHost:n}=e,d=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("title",{children:"User Dashboard | Datasquirel"}),(0,a.jsx)("meta",{name:"description",content:"Welcome to your data app"})]}),[o,c]=i.useState(null),[_,A]=i.useState(null),[b,v]=i.useState(null),[y,M]=i.useState(!1),[C,F]=i.useState(null);return(0,a.jsx)(l.A,{head:d,user:s,children:(0,a.jsxs)(g.Provider,{value:{user:s,media:t,targetMedia:C,setTargetMedia:F,folders:r,staticHost:n},children:[y&&(0,a.jsx)(w.A,{screen:!0,title:"Processing Files ..."}),(0,a.jsx)(u,{}),(0,a.jsx)(x.A,{setNewMedia:c,setLoading:M}),(0,a.jsx)(h.A,{setNewFile:A,setLoading:M}),(0,a.jsx)(f.A,{setNewVideo:v,setLoading:M}),(0,a.jsx)(j.A,{newMedia:o,setNewMedia:c,newFile:_,setNewFile:A,newVideo:b,setNewVideo:v}),(0,a.jsx)(p.A,{targetMedia:C,setTargetMedia:F,staticHost:n,media:t}),(0,a.jsx)(m.A,{}),(0,a.jsx)(N.A,{user:s})]})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[9799,4750,636,6593,8792],()=>s(54299)),_N_E=e.O()}]);