1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9161],{60397:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/update-events",function(){return t(76759)}])},76759:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return update_events}});var i=t(82729),s=t(85893),a=t(19521),r=t(67294),l=t(11163),o=t(99428),d=t(62069),c=t(39828),u=t(92369);async function updateEvent(e,n){let{firestore:t}=(0,u.UM)();if(!e){let e=(0,c.hJ)(t,"upcomingEvents");await (0,c.ET)(e,n);return}let i=(0,c.JU)(t,"upcomingEvents",e);await (0,c.r7)(i,n)}function _templateObject(){let e=(0,i._)(['\n width: 100%;\n overflow: hidden;\n border: 3px solid whitesmoke;\n border-radius: 7px;\n font-family: "Work Sans", sans-serif;\n display: flex;\n flex-direction: column;\n height: fit-content;\n img {\n width: 100%;\n height: 204.75px;\n object-fit: cover;\n }\n\n .event-info {\n flex: 1;\n background-color: whitesmoke;\n color: black;\n padding: 0.5rem;\n\n h2 {\n font-size: 20px;\n }\n\n p {\n margin: 0px;\n }\n\n .field-title {\n font-weight: 600;\n }\n\n .button-container {\n display: flex;\n justify-content: center;\n margin-top: 1.5rem;\n gap: 2rem;\n\n button {\n font-family: "Press Start 2P";\n font-size: 11px;\n }\n }\n }\n\n .edit-form {\n input {\n width: 100%;\n border-radius: 5px;\n padding: 5px;\n }\n\n textarea {\n width: 100%;\n padding: 5px;\n border-radius: 5px;\n min-height: 175px;\n }\n }\n']);return _templateObject=function(){return e},e}let h=a.default.div.withConfig({componentId:"sc-942dfe6c-0"})(_templateObject());var atoms_AdminViewEvent=function(e){let{event:n}=e,[t,i]=(0,r.useState)(n),[a,l]=(0,r.useState)(!1),[o,d]=(0,r.useState)(n.imageUrl),[c,u]=(0,r.useState)(n.title),[m,p]=(0,r.useState)(n.description),[v,x]=(0,r.useState)(n.eventLink),[f,j]=(0,r.useState)(n.order),[g,b]=(0,r.useState)(n.date),[_,w]=(0,r.useState)({});return(0,s.jsx)(h,{children:a?(0,s.jsx)("div",{className:"edit-form",children:(0,s.jsxs)("div",{className:"event-info",children:[(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Title:"}),(0,s.jsx)("input",{value:c,onChange:e=>{var n;u(n=e.target.value),w(e=>({...e,title:n}))}}),(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Description:"}),(0,s.jsx)("textarea",{value:m,onChange:e=>{var n;p(n=e.target.value),w(e=>({...e,description:n}))}}),(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Date:"}),(0,s.jsx)("input",{type:"datetime-local",placeholder:"Enter order or events",value:g,onChange:e=>{var n;b(n=e.target.value),w(e=>({...e,date:n}))}}),(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Event Link:"}),(0,s.jsx)("input",{value:v,onChange:e=>{var n;x(n=e.target.value),w(e=>({...e,eventLink:n}))}}),(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Order:"}),(0,s.jsx)("input",{placeholder:"Enter order or events",value:f,onChange:e=>{var n;j(n=e.target.value),w(e=>({...e,order:n}))}}),(0,s.jsx)("hr",{}),(0,s.jsxs)("div",{className:"button-container",children:[(0,s.jsx)("button",{type:"button",className:"nes-btn is-error",onClick:()=>void(l(!1),u(t.title),p(t.description),x(t.eventLink),w({})),children:"Cancel"}),0!=Object.keys(_).length?(0,s.jsx)("button",{type:"button",className:"nes-btn is-primary",onClick:()=>void(updateEvent(n.id,_),l(!1)),children:"Save"}):(0,s.jsx)("button",{type:"button",className:"nes-btn is-disabled",children:"Save"})]})]})}):(0,s.jsx)("div",{className:"non-edit-view",children:(0,s.jsxs)("div",{className:"event-info",children:[(0,s.jsx)("h2",{children:c}),(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Description:"}),(0,s.jsx)("p",{children:m}),(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Event Link:"}),(0,s.jsx)("p",{children:v}),(0,s.jsx)("hr",{}),(0,s.jsx)("p",{className:"field-title",children:"Order:"}),(0,s.jsx)("p",{children:f}),(0,s.jsx)("hr",{}),(0,s.jsx)("div",{className:"button-container",children:(0,s.jsx)("button",{type:"button",className:"nes-btn is-error",onClick:()=>l(!0),children:"Edit"})})]})})})};
1function update_events_templateObject(){let e=(0,i._)(["\n margin-top: 7rem;\n color: ",";\n\n .event-view {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n gap: 1.5rem;\n }\n\n h2 {\n margin-bottom: 2rem;\n }\n\n h3 {\n margin-top: 1rem;\n text-align: center;\n color: ",';\n font-size: 20px;\n font-family: "Work Sans", sans-serif;\n margin-top: 5rem;\n }\n']);return update_events_templateObject=function(){return e},e}let m=a.default.div.withConfig({componentId:"sc-be787830-0"})(update_events_templateObject(),e=>e.theme.colors.text1,e=>e.theme.colors.text4);var update_events=function(){let e=(0,l.useRouter)(),[n,t]=(0,r.useState)(!1),[i,a]=(0,r.useState)([]),{key:c}=e.query;async function getEvents(){let e=await fetch("/api/getEvents"),n=await e.json();a(n.events)}return(0,r.useEffect)(()=>{getEvents()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Z,{}),(0,s.jsx)(d.Z,{children:!n&&(0,s.jsxs)(m,{children:[(0,s.jsxs)("div",{className:"event-view",children:[i.map(e=>(0,s.jsx)(atoms_AdminViewEvent,{event:e},e)),0===i.length&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(atoms_AdminViewEvent,{event:{}}),(0,s.jsx)(atoms_AdminViewEvent,{event:{}}),(0,s.jsx)(atoms_AdminViewEvent,{event:{}})]})]}),(0,s.jsxs)("h3",{children:["Made with ",(0,s.jsx)("i",{className:"nes-icon is-small heart"})," love from the eng team :D"]})]})})]})}}},function(e){e.O(0,[1272,8700,4153,1622,9280,9428,9774,2888,179],function(){return e(e.s=60397)}),_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.