dsql-admin/dsql-app/.local_dist/server/chunks/7665.js

1 line
24 KiB
JavaScript
Raw Normal View History

2024-12-05 07:03:33 +00:00
"use strict";exports.id=7665,exports.ids=[7665],exports.modules={73413:(e,a,t)=>{t.d(a,{A:()=>r});var l=t(8732);t(82015);var i=t(55158),s=t(83158),n=t(12697),o=t(10067);function r({user:e}){return(0,l.jsx)(i.Ay,{title:"choose-media-type-popoup",noContainer:!0,wrapperClasses:"items-center",wrapperStyle:{alignItems:"center"},children:(0,l.jsxs)("div",{className:"paper items-center max-w-2xl m-auto z-50 p-4 xl:p-10",children:[(0,l.jsxs)("h4",{className:"m-0 text-center text-lg leading-tight",children:["What kind of Media do you",(0,l.jsx)("br",{}),"want to upload?"]}),(0,l.jsx)("span",{children:"Please Select the media type to upload."}),(0,l.jsxs)("div",{className:"w-full grid grid-cols-1 lg:grid-cols-2 gap-6 items-stretch",children:[(0,l.jsxs)("div",{className:"card cursor-pointer",onClick:a=>{if(e?.verification_status?.toString().match(/1/)){let e=document.getElementById("upload_image_input");e?.click()}else alert("Please Verify to Add Media");setTimeout(()=>{(0,i.fs)()},500)},children:[(0,l.jsx)(s.A,{size:50,className:"text-primary"}),(0,l.jsxs)("div",{className:"content",children:[(0,l.jsx)("span",{className:"title",children:"Images"}),(0,l.jsx)("span",{className:"text-sm",children:"General image formats like JPEG, PNG, SVG, WEBP, etc."})]})]}),(0,l.jsxs)("div",{className:"card cursor-pointer",onClick:a=>{e?.verification_status?.toString().match(/1/)?document.getElementById("upload_file_input")?.click():alert("Please Verify to Add Media"),(0,i.fs)()},children:[(0,l.jsx)(n.A,{size:50,className:"text-secondary"}),(0,l.jsxs)("div",{className:"content",children:[(0,l.jsx)("span",{className:"title",children:"Files"}),(0,l.jsx)("span",{className:"text-sm",children:"Other documents type. Like PDF, XLSX, CSV, etc."})]})]})]}),(0,l.jsx)("div",{className:"w-full grid grid-cols-1 lg:grid-cols-2 gap-6 items-stretch",children:(0,l.jsxs)("div",{className:"card cursor-pointer",onClick:a=>{e?.verification_status?.toString().match(/1/)?document.getElementById("upload_video_input")?.click():alert("Please Verify to Add Media"),(0,i.fs)()},children:[(0,l.jsx)(o.A,{size:55,className:"text-slate-600"}),(0,l.jsxs)("div",{className:"content",children:[(0,l.jsx)("span",{className:"title",children:"Videos"}),(0,l.jsxs)("span",{className:"text-sm",children:["Video Files. ",(0,l.jsx)("b",{children:"MP4"})," for now. These files can be streamed. Max 200mb"]})]})]})})]})})}},2628:(e,a,t)=>{t.d(a,{A:()=>N});var l=t(8732),i=t(82015),s=t.n(i),n=t(63715),o=t(8203),r=t(77627),d=t(32415);function c({folderName:e,folder:a,user:t}){let i=`${a?a+"/":""}${e}`,[c,m]=s().useState(!1);return(0,l.jsxs)("a",{href:`/admin/${t?.id}/media/${i}`,className:"card col items-center justify-center",onClick:e=>{if(e.target.closest("button"))return e.preventDefault()},children:[c&&(0,l.jsx)(d.A,{}),(0,l.jsx)(o.A,{sx:{fontSize:100},className:"opacity-20"}),(0,l.jsx)("span",{className:"absolute top-4 left-4 text-xs bg-slate-200 dark:bg-slate-700 px-2 py-0.5 rounded-full",children:"Folder"}),(0,l.jsx)("span",{className:"",children:e}),(0,l.jsx)("button",{className:"plain-text absolute top-2 right-2",onClick:e=>{window.confirm("Delete this Folder and all its contents?")&&(m(!0),window.confirm("NOTE: this folder and all its contents will be permanently lost. Continue?")?(0,n.A)("/api/deleteMediaFolder",{method:"post",body:{folder:i}},!0).then(e=>{e.success&&window.location.reload()}):m(!1))},children:(0,l.jsx)(r.A,{className:"opacity-30"})})]},e)}var m=t(55158),u=t(62506),p=t(1133),h=t(89095);function f({mediaObject:e,staticHost:a}){let t=e.media_thumbnail_path?e?.private?e.media_thumbnail_url:`${a}${e.media_thumbnail_path}`:e.media_thumbnail_url,i=e.media_path?e?.private?e.media_url:`${a}${e.media_path}`:e.media_url;return(0,l.jsx)(s().Fragment,{children:e.media_type?.match(/file/i)?(0,l.jsxs)("div",{className:"cursor-pointer hover:opacity-80",children:[(0,l.jsx)(h.A,{sx:{fontSize:100},className:"opacity-10"}),(0,l.jsx)("span",{className:"info w-auto small gray absolute top-4 right-4",children:e.media_type.replace(/.*\//,"").toUpperCase()})]}):e.media_type?.match(/video/i)?(0,