1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5849],{25852:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/access-requests",function(){return t(58774)}])},43625:function(e,s,t){"use strict";t.d(s,{Z:function(){return PageLoading}});var r=t(85893),n=t(733),a=t.n(n);function PageLoading(){return(0,r.jsx)("div",{className:"w-full flex justify-center items-center",children:(0,r.jsx)(a(),{type:"bars",color:"#94A3B8"})})}},21594:function(e,s,t){"use strict";t.d(s,{Z:function(){return InvitationsLayout}});var r=t(85893),n=t(41664),a=t.n(n),i=t(11163),c=t(81758),l=t(83563);function classNames(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter(Boolean).join(" ")}function InvitationsLayout(e){var s;let t=(0,i.useRouter)(),{data:n}=(0,c.ZP)("/api/access-requests",l.Z),{data:o}=(0,c.ZP)("/api/invitations",l.Z),d=[{name:"Invitations",href:"/dashboard/invitations",get current(){return this.href===t.asPath},count:null==o?void 0:null===(s=o.receivedInvitations)||void 0===s?void 0:s.length},{name:"Requests for access",href:"/dashboard/access-requests",get current(){return this.href===t.asPath},count:null==n?void 0:n.length}];return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("main",{className:"px-4 sm:px-6 lg:px-8",children:[(0,r.jsx)("div",{className:"sm:flex sm:items-center mb-4",children:(0,r.jsxs)("div",{className:"sm:flex-auto",children:[(0,r.jsx)("h1",{className:"text-base font-semibold leading-6 text-gray-900",children:"Incoming invitations and requests for access"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-gray-700",children:"Requests from other team members to collaborate on your projects or their projects"})]})}),(0,r.jsx)("header",{className:"border-b border-gray/5",children:(0,r.jsx)("nav",{className:"flex overflow-x-auto",children:(0,r.jsx)("ul",{role:"list",className:"flex min-w-full flex-none gap-x-6 text-base font-semibold leading-6 text-gray-400",children:d.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)(a(),{href:e.href,className:classNames(e.href===t.asPath?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-200 hover:text-gray-700","flex whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium"),children:[e.name,e.count?(0,r.jsx)("span",{className:classNames(e.current?"bg-indigo-100 text-indigo-600":"bg-gray-100 text-gray-900","ml-3 hidden rounded-full py-0.5 px-2.5 text-xs font-medium md:inline-block"),children:e.count}):null]})},e.name))})})}),e.children]})})}},58774:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return AccessRequests}});var r=t(85893),n=t(67294),a=t(67926),i=t(733),c=t.n(i),l=t(5121),o=t(86501),d=t(81758),u=t(11163),x=t(25675),m=t.n(x);function AccessRequest(e){var s,t;let{accessRequest:i}=e,[x,h]=(0,n.useState)(!1),{mutate:f}=(0,d.kY)();(0,u.useRouter)();let handleAcceptRequest=e=>{h(!0),l.Z.post("/api/access-requests/accept-request",{accessRequestId:i.id}).then(e=>{h(!1),f("/api/access-requests"),o.ZP.success("Request accepted successfully.")}).catch(e=>{h(!1),o.ZP.error("Something went wrong. Please try again.")})};return(0,r.jsxs)("li",{className:"flex items-center justify-between gap-x-6 py-5",children:[(0,r.jsxs)("div",{className:"flex min-w-0 gap-x-4",children:[(0,r.jsx)("div",{className:"hidden md:flex justify-center items-center flex-shrink-0 w-12 h-12 rounded-full border border-gray-300",children:(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(m(),{src:null===(s=i.project)||void 0===s?void 0:s.icon,alt:null===(t=i.project)||void 0===t?void 0:t.name,width:25,height:25,placeholder:"empty"})})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"flex items-start gap-x-3",children:(0,r.jsx)("p",{className:"text-md font-semibold leading-6 text-gray-900 capitalize truncate",children:i.project.name})}),(0,r.jsxs)("div",{className:"mt-1 flex flex-col md:flex-row items-start md:items-center gap-x-2 text-xs leading-5 text-gray-500",children:[(0,r.jsx)("p",{className:"truncate capitalize",children:i.requestor.name}),(0,r.jsx)("svg",{viewBox:"0 0 2 2",className:"h-0.5 w-0.5 fill-current hidden md:block",children:(0,r.jsx)("circle",{cx:1,cy:1,r:1})}),(0,r.jsxs)("time",{dateTime:i.createdAt,children:[(0,a.Z)(new Date(i.createdAt),new Date)," ","ago"]})]})]})]}),(0,r.jsx)("div",{className:"flex flex-none items-center gap-x-4",children:(0,r.jsxs)("button",{onClick:()=>{handleAcceptRequest(i)},className:"items-center justify-center rounded-md bg-white px-2.5 py-1.5 min-w-[150px] text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:flex",children:[x?(0,r.jsx)(c(),{t
1ype:"spin",height:"20px",width:"20px",color:"black"}):"Accept request",(0,r.jsxs)("span",{className:"sr-only",children:[", ",i.project.name]})]})})]})}function ReceivedRequests(e){let{accessRequests:s}=e;return(0,r.jsx)("ul",{role:"list",className:"divide-y divide-gray-100 w-full lg:w-8/12",children:s.map(e=>(0,r.jsx)(AccessRequest,{accessRequest:e},e.id))})}var h=t(43625),f=t(2550),g=t(21594),j=t(83563),p=t(9008),v=t.n(p);function AccessRequests(e){let{data:s,isLoading:t}=(0,d.ZP)("/api/access-requests",j.Z);return t?(0,r.jsx)(h.Z,{}):(null==s?void 0:s.length)===0?(0,r.jsxs)("main",{children:[(0,r.jsx)(v(),{children:(0,r.jsx)("title",{children:"Requests for access | Storylist"})}),(0,r.jsxs)("div",{className:"text-center mt-12",children:[(0,r.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),(0,r.jsx)("h3",{className:"mt-2 text-sm font-semibold text-gray-900",children:"No requests for access"})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v(),{children:(0,r.jsx)("title",{children:"Requests for access | Storylist"})}),(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)(ReceivedRequests,{accessRequests:s})})})]})}AccessRequests.getLayout=function(e){return(0,r.jsx)(f.Z,{children:(0,r.jsx)(g.Z,{children:e})})}}},function(e){e.O(0,[3714,3061,5075,225,8950,2550,9774,2888,179],function(){return e(e.s=25852)}),_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.