PageSourceSearch

https://duckdbsnippets.com/_next/static/chunks/pages/admin-dabea836fda5929b.js

js duckdbsnippets.com collected 2026-10-03 23:20:09 UTC 4,365 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[964],{36004:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return n(37726)}])},37726:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return P},default:function(){return G}});var i=n(31549),o=n(50680),a=n(44151),r=n(79949),l=n(84363),s=n.n(l);let u={encode:e=>s().stringify(e),decode:e=>s().parse(e)};var d=n(39590),p=n(97580),c=n(34769),g=n(62002),h=n(72011),f=n(87182),v=n(9840),m=n(76477);let C=e=>!Object.keys(e).length;var E=n(23288),w=n(40316);let S=d.ZP.div.withConfig({componentId:"sc-1f9eaf5f-0"})(["max-width:900px;margin:0 auto;display:flex;flex-direction:column;"]),x=(0,d.ZP)(g.Z).withConfig({componentId:"sc-1f9eaf5f-1"})(["align-self:flex-start;"]),A=d.ZP.div.withConfig({componentId:"sc-1f9eaf5f-2"})(["display:flex;align-items:flex-end;flex-direction:column;margin-bottom:24px;gap:24px;","{flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:64px;}"],p._r),_=d.ZP.div.withConfig({componentId:"sc-1f9eaf5f-3"})(["","{font-weight:700;}"],p._r);var P=!0,G=()=>{let[e,t]=(0,a.useQueryParams)({orderBy:u,status:a.StringParam}),n=(0,r.useRouter)(),l=C(e.orderBy)?{"snippet.createdAt":"DESC"}:e.orderBy,s={status:e.status||m.h.IN_REVIEW},{data:d,isLoading:p}=(0,o.Z)({query:{orderBy:l,filters:{...s}},options:{enabled:n.isReady}}),g=(0,c.Z)(null==d?void 0:d.data),P=JSON.parse(JSON.stringify({...d,data:g})),G="DESC"===l["snippet.createdAt"]?"newest":"oldest",b=n=>{t({...e,status:n})};return(0,i.jsx)(v.Z,{title:"Admin",containerVariants:{mobile:"lg",desktop:"md"},backgroundOffset:-90,children:(0,i.jsxs)(S,{children:[(0,i.jsxs)(A,{children:[(0,i.jsxs)(x,{children:[(0,i.jsx)(h.Z,{onClick:()=>b(m.h.IN_REVIEW),isActive:s.status===m.h.IN_REVIEW,children:w.a[m.h.IN_REVIEW].label}),(0,i.jsx)(h.Z,{onClick:()=>b(m.h.APPROVED),isActive:s.status===m.h.APPROVED,children:w.a[m.h.APPROVED].label}),(0,i.jsx)(h.Z,{onClick:()=>b(m.h.REJECTED),isActive:s.status===m.h.REJECTED,children:w.a[m.h.REJECTED].label})]}),(0,i.jsx)(f.Z,{showAlwaysTitle:!0,value:G,customListener:()=>(0,i.jsx)(_,{children:"Order: ".concat(G.charAt(0).toUpperCase()+G.slice(1))}),items:[{label:"Newest",value:"newest"},{label:"Oldest",value:"oldest"}],onChange:n=>{t({...e,orderBy:{"snippet.createdAt":"newest"===n?"DESC":"ASC"}})}})]}),(0,i.jsx)(E.Z,{snippets:null==P?void 0:P.data,showAdminActions:!0,totalPages:null==P?void 0:P.totalPages,isLoading:p,skeletonCount:3})]})})}},34769:function(e,t,n){"use strict";var i=n(99655),o=n.n(i);let a=e=>{let t=e.split("/")[1];return"ATTACH '".concat(e,"' AS ").concat(t,";\nUSE ").concat(t,";")};t.Z=(e,t)=>{if(e)return e.map(e=>{var t,n,i;let r={...e,formattedCode:o().highlight(e.code,o().languages[String(null===(t=e.language)||void 0===t?void 0:t.name).toLowerCase()],String(null===(n=e.language)||void 0===n?void 0:n.name).toLowerCase())};return r.snippetGroup?{...r,snippetGroup:{...r.snippetGroup,snippets:null===(i=r.snippetGroup)||void 0===i?void 0:i.snippets.map(e=>{var t,n;return{...e,formattedCode:o().highlight(e.code,o().languages[String(null===(t=e.language)||void 0===t?void 0:t.name).toLowerCase()],String(null===(n=e.language)||void 0===n?void 0:n.name).toLowerCase())}}),formattedShareUrl:r.snippetGroup.url?o().highlight(a(r.snippetGroup.url),o().languages.sql,"sql"):void 0,mdShareCode:r.snippetGroup.url?a(r.snippetGroup.url):void 0}}:r});if(t){var n,i,r,l;return{...t,formattedCode:o().highlight(t.code,o().languages[String(null===(n=t.language)||void 0===n?void 0:n.name).toLowerCase()],String(null===(i=t.language)||void 0===i?void 0:i.name).toLowerCase()),snippetGroup:t.snippetGroup?{...t.snippetGroup,snippets:null==t?void 0:null===(r=t.snippetGroup)||void 0===r?void 0:r.snippets.map(e=>{var t,n;return{...e,formattedCode:o().highlight(e.code,o().languages[String(null===(t=e.language)||void 0===t?void 0:t.name).toLowerCase()],String(null===(n=e.language)||void 0===n?void 0:n.name).toLowerCase())}}),formattedShareUrl:(null===(l=t.snippetGroup)||void 0===l?void 0:l.url)?o().highlight("ATTACH '".concat(t.snippetGroup.url,"' AS ").concat(t.snippetGroup.url.split("/")[1],";\nUSE ").concat(t.snippetGroup.url.split("/")[1],";"),o().languages.sql,"sql"):null}:null}}return[]}}},function(e){e.O(0,[760,150,723,914,317,653,888,774,179],function(){return e(e.s=36004)}),_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.