(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{5557:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return s(5171)}])},5171:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSG:function(){return p},default:function(){return h}});var l=s(5893),r=s(7294),n=s(7205);let a=(e,t)=>e===t?"border-t":"";var o=e=>{let{activeTab:t,setActiveTab:s}=e;return(0,l.jsxs)("div",{className:"flex items-center justify-center text-center gap-5 border-t mb-4",children:[(0,l.jsx)("button",{onClick:()=>s("photos"),className:"uppercase tracking-tight font-semibold text-sm border-black pt-3 px-3 ".concat(a("photos",t)),children:"Photos"}),(0,l.jsx)("button",{onClick:()=>s("videos"),className:"uppercase tracking-tight font-semibold text-sm pt-3 px-3 border-black ".concat(a("videos",t)),children:"Videos"})]})},i=e=>{let{media:t,type:s,setOverlayContent:r,currentIndex:n,limitPerPage:a}=e;return(0,l.jsx)("main",{className:"grid grid-cols-3 gap-1",children:t.slice(n,a).map(e=>{let{id:t,url:n,previewPath:a,embedPath:o=n}=e;return(0,l.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferer",onClick:e=>{e.preventDefault(),r({url:o,type:s})},children:(0,l.jsx)("img",{alt:n,src:a,className:"aspect-".concat(s)})},t)})})},c=e=>{let{profile:t,totalPosts:s}=e;return(0,l.jsxs)("div",{className:"flex flex-warp",children:[(0,l.jsx)("div",{className:"lg:w-4/12 w-3/12 md:py-10 lg:px-20 md:px-10",children:(0,l.jsx)("img",{alt:t.display_name,src:t.avatar,className:"w-100 rounded-full mx-auto border border-gray-200 p-1"})}),(0,l.jsxs)("div",{className:"lg:w-9/12 md:w-10/12 px-10 mb-5 md:p-5",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("h2",{className:"text-2xl font-semibold",children:t.username}),(0,l.jsxs)("div",{className:"ml-4",children:[(0,l.jsx)("a",{className:"rounded-md bg-gray-100 px-5 font-semibold py-2 ml-2 text-sm leading-relaxed",href:t.follow_url,children:"Follow"}),(0,l.jsx)("a",{className:"rounded-md bg-gray-100 px-5 font-semibold py-2 ml-2 text-sm leading-relaxed",href:t.message_url,children:"Message"})]})]}),(0,l.jsx)("div",{className:"my-5 font-bold text-sm",children:(0,l.jsxs)("p",{children:[s," posts"]})}),(0,l.jsx)("p",{className:"font-bold mb-1",children:t.display_name}),(0,l.jsx)("p",{children:t.about}),(0,l.jsx)("p",{className:"leading-loose font-semibold text-blue-900",children:(0,l.jsx)("a",{target:"_blank",rel:"noopener noreferer",href:"https://".concat(t.link),children:t.link})})]})]})};let d=e=>{let{overlayContent:t}=e;return(null==t?void 0:t.type)===n.oZ.PHOTOS?(0,l.jsx)("img",{alt:null==t?void 0:t.url,src:null==t?void 0:t.url,className:"z-20 cursor-default"}):(null==t?void 0:t.type)===n.oZ.VIDEOS?(0,l.jsx)("iframe",{width:"50%",height:"50%",allow:"fullscreen",sandbox:"allow-same-origin allow-scripts allow-popups",src:null==t?void 0:t.url}):void 0};var m=e=>{let{overlayContent:t,closeOverlay:s}=e,r=(null==t?void 0:t.type)!==void 0;return(0,l.jsxs)("div",{onClick:s,className:"".concat(r?"bg-neutral-800/95 fixed w-screen h-screen left-0 top-0 cursor-pointer":""),children:[r?(0,l.jsx)("p",{onClick:s,className:"fixed right-0 bottom-0 m-5 text-white rounded text-sm",children:'Click anywhere or press "Escape" to close'}):null,(0,l.jsx)("div",{className:"flex justify-center items-center ".concat(r?"h-screen w-screen":"h-0 w-0"),children:(0,l.jsx)(d,{overlayContent:t})})]})},x=s(356);let u=e=>{let{activeTab:t,photos:s,videos:r,...a}=e;return t===n.oZ.PHOTOS?(0,l.jsx)(i,{media:s,type:t,...a}):t===n.oZ.VIDEOS?(0,l.jsx)(i,{media:r,type:t,...a}):(0,l.jsx)("div",{className:"text-center pt-10 font-bold text-2xl",children:"nice try"})};var p=!0,h=e=>{let{photos:t,videos:s,totalPosts:a}=e,[i,d]=(0,r.useState)(n.oZ.PHOTOS),[p,h]=(0,r.useState)(0),[f,v]=(0,r.useState)(null),j=()=>v(null),b=e=>{let{keyCode:t}=e;t===n.O_&&j()};return(0,r.useEffect)(()=>(window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}),[b]),(0,l.jsxs)(r.Fragment,{children:[(0,l.jsx)(c,{profile:x.N5,totalPosts:a}),(0,l.jsx)(o,{activeTab:i,setActiveTab:d}),(0,l.jsx)(m,{overlayContent:f,closeOverlay:j}),(0,l.jsx)(u,{currentIndex:p,setCurrentIndex:h,limitPerPage:n.Zv,activeTab:i,setOverlayContent:v,photos:t,videos:s})]})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=5557)}),_N_E=e.O()}]);