PageSourceSearch

https://naijabarrister.com/_next/static/chunks/pages/dashboard-f96839bc4add2f29.js

js naijabarrister.com collected 2026-10-02 16:03:58 UTC 14,018 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8026],{81976:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard",function(){return n(77747)}])},93996:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var s=n(85893),r=(n(67294),n(34051)),a=n.n(r),i=n(41664),c=n(62030),l=n(27856),o=n.n(l),u=n(47516),d=n(53854),x=n(89583),h=n(88767),f=n(40611),m=n(74931);function p(e,t,n,s,r,a,i){try{var c=e[a](i),l=c.value}catch(o){return void n(o)}c.done?t(l):Promise.resolve(l).then(s,r)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(s,r){var a=e.apply(t,n);function i(e){p(a,s,r,i,c,"next",e)}function c(e){p(a,s,r,i,c,"throw",e)}i(void 0)}))}}var j=function(e){var t=e.question,n=e.user,r=void 0===n?null:n,l=(0,h.useQueryClient)(),p=(0,h.useMutation)({mutationFn:v(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.Z.delete("/api/questions/".concat(t.id));case 2:case"end":return e.stop()}}),e)}))),onSuccess:v(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.invalidateQueries("questions");case 2:m.ZP.success("Question deleted successfully");case 3:case"end":return e.stop()}}),e)}))),onError:function(e){console.log(e)}}),j=function(){var e=v(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.confirm("Are you sure you want to delete this question?")){e.next=3;break}return e.next=3,p.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,s.jsxs)("div",{className:"py-4 pl-6 px-4 bg-white border border-slate-300 rounded-lg relative",children:[(0,s.jsx)(x.MXt,{className:"absolute -left-4 top-6 text-3xl text-slate-400 bg-white border-4 border-slate-200 rounded-full"}),(0,s.jsx)("h4",{children:(0,s.jsx)(i.default,{href:"/dashboard/questions/".concat(t.slug),children:(0,s.jsx)("a",{className:"text-slate-800",children:(0,s.jsxs)("i",{className:"text-slate-600 text-sm",children:["Question asked"," ",(0,c.Z)(new Date(t.createdAt),{addSuffix:!0})]})})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:o().sanitize(t.question)}}),(0,s.jsxs)("ul",{className:"flex items-center space-x-4",children:[(0,s.jsx)("li",{children:(0,s.jsx)(i.default,{href:"/dashboard/questions/".concat(t.slug),children:(0,s.jsxs)("a",{className:"text-blue-800 flex items-center space-x-2",children:[(0,s.jsx)(u.rKo,{})," ",(0,s.jsxs)("span",{children:[t.responses.length," Response",t.responses.length>1?"s":""]})]})})}),(0,s.jsx)("li",{children:(0,s.jsx)(i.default,{href:"/dashboard/questions/".concat(t.slug),children:(0,s.jsxs)("a",{className:"text-blue-800 flex items-center space-x-2",children:[(0,s.jsx)("span",{children:"View question"})," ",(0,s.jsx)(d.Hi9,{})]})})}),r&&"admin"===r.role?(0,s.jsx)("li",{children:(0,s.jsx)("button",{onClick:j,className:"text-red-600 hover:text-red-400",children:"Delete"})}):null]})]})]})},b=n(88362),g=n(80471),w=n(2282),N=n(21190),y=n(6580);var k=function(e){var t=e.limit,n=void 0===t?5:t,r=(0,w.a)().user,a=(0,h.useInfiniteQuery)(["questions"],(function(e){var t=e.pageParam,s=void 0===t?1:t;return f.Z.get("/api/questions/",{params:{page:s,limit:n,isVerified:!0}}).then((function(e){return e.data})).catch((function(e){console.log(e)}))}),{getNextPageParam:function(e,t){return e.next.page||void 0},keepPreviousData:!0}),i=a.data,c=a.isLoading,l=a.hasNextPage,o=a.isFetchingNextPage,u=a.fetchNextPage;return c?(0,s.jsx)(b.Z,{}):(0,s.jsx)("div",{children:(0,s.jsx)(N.M,{children:i.pages&&i.pages.length>0?(0,s.jsxs)("div",{className:"space-y-4",children:[i.pages.map((function(e,t){return(0,s.jsx)("div",{className:"space-y-4",children:e.data.map((function(e){return(0,s.jsx)(y.E.div,{initial:{opacity:0}
1,exit:{opacity:0,x:-20},animate:{opacity:1},layout:!0,children:(0,s.jsx)(j,{question:e,user:r||null},e.id)},e.id)}))},"page__".concat(t+1))})),l?(0,s.jsx)("button",{onClick:u,className:"bg-white py-2 px-6 rounded-md border border-slate-300 font-bold disabled:opacity-50",disabled:o,children:o?(0,s.jsx)(g.frZ,{className:"animate-spin text-2xl"}):"Load more"}):(0,s.jsx)("div",{children:"No more questions"})]}):null})})}},69581:function(e,t,n){"use strict";var s=n(85893),r=(n(67294),n(41664)),a=n(53854),i=n(89583),c=n(67926),l=n(25675);t.Z=function(e){var t,n,o,u=e.brief,d=e.user;return(0,s.jsxs)("div",{className:"flex space-x-3 items-center py-4 px-4",children:[(0,s.jsx)("div",{children:(0,s.jsx)(r.default,{href:"/dashboard/briefs/".concat(u.slug),children:(0,s.jsx)("a",{children:(0,s.jsx)(l.default,{src:(null===(t=u.profile)||void 0===t?void 0:t.avatar)||"/images/avatar.png",width:48,height:48,alt:(null===(n=u.profile)||void 0===n?void 0:n.fullname)||"",className:"rounded-full object-cover"})})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-bold",children:(0,s.jsx)(r.default,{href:"/dashboard/briefs/".concat(u.slug),children:(0,s.jsx)("a",{className:"text-slate-800 hover:underline hover:text-blue-800",children:u.title})})}),(0,s.jsxs)("ul",{className:"flex items-center space-x-4",children:[(0,s.jsx)("li",{children:(0,s.jsxs)("span",{className:"text-slate-400 flex items-center",children:[(0,s.jsx)(a.XAC,{className:"mr-1"})," ",u.city,", ",u.state]})}),(0,s.jsx)("li",{children:(0,s.jsxs)("span",{className:"".concat(new Date(u.date)<Date.now()?"text-red-400":"text-slate-500","  text-sm "),children:["Due"," ",(0,c.Z)(new Date(u.date),Date.now(),{addSuffix:!0})]})}),(0,s.jsx)("li",{children:(o=u.applicants,o.filter((function(e){return e.user===d.id})).length>0?(0,s.jsxs)("div",{className:"text-green-600 flex items-center text-sm ",children:[(0,s.jsx)(i.FJM,{className:"mr-1"})," Applied"]}):null)})]})]})]})}},88362:function(e,t,n){"use strict";var s=n(85893),r=(n(67294),n(80471));t.Z=function(){return(0,s.jsx)("div",{className:"py-8 px-4 border border-slate-300 rounded-lg bg-white",children:(0,s.jsx)(r.frZ,{size:"1.5em",className:"animate animate-spin mx-auto"})})}},77747:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return q}});var s=n(85893),r=n(2282),a=n(80575),i=n(34051),c=n.n(i),l=n(41664),o=n(67294),u=n(40611);function d(e,t,n,s,r,a,i){try{var c=e[a](i),l=c.value}catch(o){return void n(o)}c.done?t(l):Promise.resolve(l).then(s,r)}function x(e){return function(){var t=this,n=arguments;return new Promise((function(s,r){var a=e.apply(t,n);function i(e){d(a,s,r,i,c,"next",e)}function c(e){d(a,s,r,i,c,"throw",e)}i(void 0)}))}}var h=function(e){var t=e.user,n=(0,o.useState)(0),r=n[0],a=n[1];return(0,o.useEffect)((function(){function e(){return(e=x(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.Z.get("/api/cms/briefs",{params:{author:t.id}});case 3:n=e.sent.data,a(n.totalCount),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[r]),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:r}),(0,s.jsx)("p",{children:"Your Briefs"}),(0,s.jsx)(l.default,{href:"/dashboard/briefs/new",children:(0,s.jsx)("a",{children:"Add new"})})]})};function f(e,t,n,s,r,a,i){try{var c=e[a](i),l=c.value}catch(o){return void n(o)}c.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(s,r){var a=e.apply(t,n);function i(e){f(a,s,r,i,c,"next",e)}function c(e){f(a,s,r,i,c,"throw",e)}i(void 0)}))}}var p=function(e){var t=e.user,n=(0,o.useState)(0),r=n[0],a=n[1];return(0,o.useEffect)((function(){function e(){return(e=m(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.Z.get("/api/cms/articles",{params:{author:t.id}});case 3:n=e.sent.data,a(n.totalCount),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[r]),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:r}),(0,s.jsx)("p",{children:"Your Articles"}),(0,s.jsx)(l.default,{href:"/dashboard/articles/new",children:(0,s.jsx)("a",{className:"text-sm py-2 px-4 roun
1ded-sm bg-white border border-blue-500 hover:drop-shadow-sm hover:no-underline hover:bg-slate-50 font-bold text-blue-800 hover:text-blue-900",children:"Add new"})})]})},v=n(89583),j=(n(25675),n(69581));function b(e,t,n,s,r,a,i){try{var c=e[a](i),l=c.value}catch(o){return void n(o)}c.done?t(l):Promise.resolve(l).then(s,r)}var g=function(e){var t=e.user,n=(0,o.useState)(null),r=n[0],a=n[1];return(0,o.useEffect)((function(){var e=function(){var e,t=(e=c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.Z.get("/api/cms/briefs",{params:{limit:5}});case 3:t=e.sent.data,a(t),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})),function(){var t=this,n=arguments;return new Promise((function(s,r){var a=e.apply(t,n);function i(e){b(a,s,r,i,c,"next",e)}function c(e){b(a,s,r,i,c,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}();e()}),[]),(0,s.jsx)("div",{children:r&&(0,s.jsx)("div",{children:r.data.length>0?(0,s.jsx)("div",{className:"border border-slate-300 divide-y divide-slate-300 rounded-md bg-white",children:r.data.map((function(e){return(0,s.jsx)(j.Z,{brief:e,user:t},e.id)}))}):(0,s.jsx)("div",{})})})},w=n(63750),N=n(93996);n(88767);var y=function(e){return e.user,(0,s.jsx)("div",{children:(0,s.jsx)(N.Z,{limit:5})})},k=n(74931);function P(e,t,n,s,r,a,i){try{var c=e[a](i),l=c.value}catch(o){return void n(o)}c.done?t(l):Promise.resolve(l).then(s,r)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(s,r){var a=e.apply(t,n);function i(e){P(a,s,r,i,c,"next",e)}function c(e){P(a,s,r,i,c,"throw",e)}i(void 0)}))}}var Z=function(e){var t=e.user,n=(0,o.useState)(0),r=n[0],a=n[1];return(0,o.useEffect)((function(){function e(){return(e=_(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.Z.get("/api/users/".concat(t.id,"/contacts/count"));case 3:n=e.sent.data,a(n.totalCount||0),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[r]),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:r}),(0,s.jsx)("p",{children:"Contacts"}),(0,s.jsx)(l.default,{href:"/dashboard/contacts/",children:(0,s.jsx)("a",{className:"text-sm py-2 px-4 rounded-sm bg-white border border-blue-500 hover:drop-shadow-sm hover:no-underline hover:bg-slate-50 font-bold text-blue-800 hover:text-blue-900",children:"View all"})})]})};function q(){var e=(0,r.a)(),t=e.user,n=e.loading;return n?null:(0,s.jsx)(s.Fragment,{children:!n&&t&&(0,s.jsxs)(a.Z,{title:"Hello ".concat(t.first_name),children:[(0,s.jsxs)("ul",{className:"md:inline-flex md:space-x-6 mb-8 md:text-base text-xs md:space-y-0 space-y-3",children:[(0,s.jsxs)("li",{className:"text-sm",children:["Your profile link:"," ",(0,s.jsx)("a",{href:"".concat("https://naijabarrister.com","/").concat(t.username),target:"_blank",rel:"noreferrer",children:"".concat("https://naijabarrister.com","/").concat(t.username)}),(0,s.jsx)("button",{className:"ml-1 text-slate-500",onClick:function(){navigator.clipboard.writeText("".concat("https://naijabarrister.com","/").concat(t.username)).then((function(){return k.ZP.success("Profile link copied successfully")})).catch((function(e){return console.log(e)}))},children:(0,s.jsx)(v.esY,{})})]}),(0,s.jsx)("li",{children:(0,s.jsx)(l.default,{href:"/dashboard/profile",children:(0,s.jsxs)("a",{className:"flex items-center space-x-1 text-sm",children:[(0,s.jsx)(v.Xws,{})," ",(0,s.jsx)("span",{children:"Edit profile"})]})})}),(0,s.jsx)("li",{children:(0,s.jsx)(l.default,{href:"/".concat(t.username),children:(0,s.jsxs)("a",{target:"_blank",rel:"noreferrer",className:"flex items-center space-x-1 text-sm",children:[(0,s.jsx)(v.CkN,{}),(0,s.jsx)("span",{children:"View profile"})]})})}),t&&"admin"===t.role?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("li",{children:(0,s.jsx)(l.default,{href:"/dashboard/admin",children:(0,s.jsx)("a",{target:"_blank",rel:"noreferrer",className:"flex items-center space-x-1 text-sm",children:(0,s.jsx)("span",{children:"Users"})})})}),(0,s.jsx)("li",{children:(0,s.jsx)(l.default,{href:"/dashboard/admin/community",children:(0,s.jsx)("a",{target:"_blank",rel:"noreferrer",className:"flex items-center space-x-1 text-sm",children:(0,s.jsx)("span",{children:"Communities"})})})})]}):null]}),(0,s.jsxs)("div",{className:"md:grid grid-cols-3 gap-4 space-y-4 md:space-y-0 dashboard-stats",children:[(0,s.jsx)(h,{user:t}),(0,s.jsx)(p,{user:t}),(0,s.jsx)(Z,{user:t})]}),(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h4",{className:"text-xl font-black mb-3",children:"Recent questions"}),(0,s.jsx)(l.default,{href:"/dashboard/questions",children:(0,s.jsxs)("a",{className:"inline-flex items-center space-x-4",children:["View all ",(0,s.jsx)(w.lzl,{size:"1em",className:"ml-3"})]})})]}),(0,s.jsx)(y,{user:t})]}),(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h4",{className:"text-xl font-black mb-3",children:"Recent briefs"}),(0,s.jsx)(l.default,{href:"/dashboard/briefs",children:(0,s.jsxs)("a",{className:"inline-flex items-center space-x-4",children:["View all ",(0,s.jsx)(w.lzl,{size:"1em",className:"ml-3"})]})})]}),(0,s.jsx)(g,{user:t})]})]})})}}},function(e){e.O(0,[5445,2013,9866,955,3874,4617,6556,3276,6653,7856,7926,8941,575,9774,2888,179],(function(){return t=81976,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.