PageSourceSearch

https://bosscoder-website.vercel.app/_next/static/chunks/pages/admin/reviewers-video-1574289e694a4941.js

js bosscoder-website.vercel.app collected 2026-10-03 06:20:56 UTC 7,755 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85535],{55835:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/reviewers-video",function(){return l(18700)}])},40640:function(e,t,l){"use strict";var r=l(67294);t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:90,l=!(arguments.length>2)||void 0===arguments[2]||arguments[2],[i,s]=(0,r.useState)("");return(0,r.useEffect)(()=>{if(l){let l=0,r=setInterval(()=>{l<e.length?(s(e.slice(0,l+1)),l++):clearInterval(r)},t);return()=>clearInterval(r)}},[e,t,l]),i}},31134:function(e,t,l){"use strict";l.d(t,{Z:function(){return c}});var r=l(67294);let i=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,l)=>l?l.toUpperCase():t.toLowerCase()),a=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},n=function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.filter((e,t,l)=>!!e&&""!==e.trim()&&l.indexOf(e)===t).join(" ").trim()};var d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.forwardRef)((e,t)=>{let{color:l="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:o="",children:c,iconNode:u,...h}=e;return(0,r.createElement)("svg",{ref:t,...d,width:i,height:i,stroke:l,strokeWidth:a?24*Number(s)/Number(i):s,className:n("lucide",o),...h},[...u.map(e=>{let[t,l]=e;return(0,r.createElement)(t,l)}),...Array.isArray(c)?c:[c]])}),c=(e,t)=>{let l=(0,r.forwardRef)((l,s)=>{let{className:d,...c}=l;return(0,r.createElement)(o,{ref:s,iconNode:t,className:n("lucide-".concat(i(a(e))),"lucide-".concat(e),d),...c})});return l.displayName=a(e),l}},78497:function(e,t,l){"use strict";l.d(t,{Z:function(){return r}});let r=(0,l(31134).Z)("menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},18700:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return h}});var r=l(85893),i=l(67294),s=l(40640),a=function(){let[e,t]=(0,i.useState)(""),[l,a]=(0,i.useState)(""),[n,d]=(0,i.useState)(!1),o=(0,s.Z)("Please Enter the Correct Video title",90),c=(0,s.Z)("Please Enter the Correct Youtube Video Link",50),u=async()=>{if(e&&l)try{if(!(await fetch("/api/admin/reviewers-video",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,link:l})})).ok)throw Error("Failed to upload video");d(!0),t(""),a("")}catch(e){console.error("Error uploading video: ",e)}else alert("Please provide both a title and a video link.")};return(0,r.jsxs)("div",{className:"rounded-lg bg-white p-6 shadow-[0_1px_3px_0_rgba(0,0,0,0.25)]",children:[(0,r.jsx)("p",{className:"mb-4 text-2xl",children:"Upload Video"}),n&&(0,r.jsx)("p",{className:"mb-4 font-semibold text-green-600",children:"Video uploaded successfully!"}),(0,r.jsxs)("div",{className:"mb-6 rounded-md border border-gray-300 bg-gray-100 p-4",children:[(0,r.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"Instructions for Uploading Videos:"}),(0,r.jsxs)("ul",{className:"list-disc pl-6 text-gray-700",children:[(0,r.jsx)("li",{className:"mb-2",children:'Always enter the link from the "Share" button on the video platform (e.g., YouTube).'}),(0,r.jsx)("li",{className:"mb-2",children:"Ensure the video title is descriptive and relevant."}),(0,r.jsx)("li",{className:"mb-2",children:"Verify that the link is a valid public link and not a private or restricted video."}),(0,r.jsx)("li",{className:"mb-2",children:'If uploading from YouTube, ensure the link starts with "https://youtu.be/".'})]})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"mb-2 block text-lg",children:"Video Title:"}),(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),className:"w-full rounded border border-gray-300 p-2 placeholder:text-[14px]",placeholder:o})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"mb-2 block text-lg",children:"Video Link (YouTube or other):"}
1),(0,r.jsx)("input",{type:"text",value:l,onChange:e=>a(e.target.value),className:"w-full rounded border border-gray-300 p-2 placeholder:text-[14px]",placeholder:c})]}),(0,r.jsx)("button",{onClick:u,className:"flex items-center justify-center rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-800",children:"Upload Video"})]})},n=function(){let[e,t]=(0,i.useState)([]),[l,s]=(0,i.useState)(null),[a,n]=(0,i.useState)(""),[d,o]=(0,i.useState)("");(0,i.useEffect)(()=>{(async()=>{let e=await fetch("/api/admin/reviewers-video"),{videos:l}=await e.json();t(l)})()},[]);let c=async l=>{confirm("Are you sure you want to delete this video?")&&(await fetch("/api/admin/reviewers-video/".concat(l),{method:"DELETE"}),t(e.filter(e=>e.id!==l)))},u=e=>{s(e),n(e.title),o(e.link)},h=()=>{s(null),n(""),o("")},x=async()=>{l&&(await fetch("/api/admin/reviewers-video/".concat(l.id),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,link:d})}),t(e.map(e=>e.id===l.id?{...e,title:a,link:d}:e)),h())};return(0,r.jsxs)("div",{className:"mt-4 rounded-[6px] p-6 shadow-[0_1px_3px_0_rgba(0,0,0,0.25)] md:mt-6",children:[(0,r.jsx)("p",{className:"mb-4 text-center text-2xl font-semibold underline",children:"Uploaded Videos"}),0===e.length?(0,r.jsx)("p",{children:"No videos uploaded yet."}):(0,r.jsx)("ul",{className:"space-y-6 overflow-y-scroll",children:e.map(e=>(0,r.jsxs)("li",{className:"flex items-start justify-between p-2 shadow-sm",children:[(0,r.jsx)("div",{className:"flex items-start",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-bold",children:e.title}),(0,r.jsx)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:"Watch Video"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("button",{onClick:()=>u(e),className:"mr-2 rounded bg-yellow-500 px-3 py-1 text-white",children:"Edit"}),(0,r.jsx)("button",{onClick:()=>c(e.id),className:"rounded bg-red-600 px-3 py-1 text-white",children:"Delete"})]})]},e.id))}),l&&(0,r.jsx)("div",{className:"fixed inset-0 flex items-center justify-center bg-gray-900 bg-opacity-75",children:(0,r.jsxs)("div",{className:"w-full max-w-lg rounded-lg bg-white p-6",children:[(0,r.jsx)("h2",{className:"mb-4 text-xl font-bold",children:"Edit Video"}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"mb-2 block",children:"Video Title:"}),(0,r.jsx)("input",{type:"text",value:a,onChange:e=>n(e.target.value),className:"w-full rounded border border-gray-300 p-2"})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"mb-2 block",children:"Video Link:"}),(0,r.jsx)("input",{type:"text",value:d,onChange:e=>o(e.target.value),className:"w-full rounded border border-gray-300 p-2"})]}),(0,r.jsxs)("div",{className:"flex justify-end",children:[(0,r.jsx)("button",{onClick:x,className:"mr-4 rounded bg-blue-600 px-4 py-2 text-white",children:"Save"}),(0,r.jsx)("button",{onClick:h,className:"rounded bg-gray-300 px-4 py-2 text-gray-700",children:"Cancel"})]})]})})]})},d=l(97629),o=l(9008),c=l.n(o);function u(){return(0,r.jsxs)("div",{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Reviewers Video"})}),(0,r.jsxs)("div",{className:"container mx-auto mt-20 max-w-[1160px] py-14",children:[(0,r.jsx)("p",{className:"mb-6 text-center text-3xl font-semibold underline",children:"Admin - Upload Video"}),(0,r.jsx)(a,{}),(0,r.jsx)(n,{})]})]})}var h=u;u.getLayout=e=>(0,r.jsx)(d.Z,{children:e})}},function(e){e.O(0,[25675,97629,92888,49774,40179],function(){return e(e.s=55835)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.