PageSourceSearch

https://www.mehdio.com/_next/static/chunks/app/blog/page-bbaf3e7445ab798b.js

js mehdio.com collected 2026-09-25 20:22:36 UTC 10,079 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[404],{5146:function(e,t,r){Promise.resolve().then(r.bind(r,1588))},7138:function(e,t,r){"use strict";r.d(t,{default:function(){return l.a}});var a=r(231),l=r.n(a)},1588:function(e,t,r){"use strict";r.d(t,{default:function(){return h}});var a=r(7437),l=r(2265),s=r(7714),n=r(7138),o=r(6235),i=r(7730);function c(e){var t;let{post:r}=e,l=r.post_date?(0,o.WU)(new Date(r.post_date),"MMM d, yyyy"):null,s=(()=>{if(r.thumbnail_url)return r.thumbnail_url;if(r.content){let e=r.content.match(/<img[^>]+src="([^">]+)"/);if(e&&e[1])return e[1]}return null})(),c=(null===(t=r.tags)||void 0===t?void 0:t.filter(e=>e&&""!==e.trim()))||[],d="substack"===r.source&&r.slug,u=d?"/blog/".concat(r.slug):r.url||"#";return(0,a.jsx)(n.default,{href:u,...d?{}:{target:"_blank",rel:"noopener noreferrer"},className:"group block",children:(0,a.jsxs)("article",{className:"relative border-b border-neutral-800 py-5 transition-all duration-300 hover:bg-gradient-to-r hover:from-transparent hover:via-neutral-900/50 hover:to-transparent",children:[(0,a.jsx)("div",{className:"absolute bottom-0 left-0 h-[2px] w-0 bg-gradient-to-r from-blog-yellow to-blog-coral transition-all duration-300 group-hover:w-full"}),(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"mb-1.5 text-base font-semibold text-neutral-100 transition-colors group-hover:text-blog-yellow md:text-lg",children:r.title}),r.subtitle&&(0,a.jsx)("p",{className:"mb-2 line-clamp-2 text-sm text-neutral-400",children:r.subtitle}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-neutral-500",children:[l&&(0,a.jsx)("span",{className:"font-medium uppercase tracking-wide",children:l}),r.source&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-neutral-700",children:"•"}),(0,a.jsx)("span",{className:"font-medium ".concat("motherduck"===r.source?"text-blog-coral":"text-blog-yellow"),children:"motherduck"===r.source?"MotherDuck":"MEHDIO"})]}),c.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-neutral-700",children:"•"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.slice(0,3).map((e,t)=>(0,a.jsx)("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400",children:e},t))})]})]})]}),s&&(0,a.jsx)("div",{className:"relative h-16 w-24 flex-shrink-0 overflow-hidden rounded-md md:h-20 md:w-32",children:(0,a.jsx)(i.default,{src:s,alt:r.title||"Blog post",fill:!0,className:"object-cover transition-transform duration-300 group-hover:scale-105",sizes:"128px",fallbackSrc:"/assets/placeholder-image.svg"})})]})]})})}var d=r(2869);let u=(0,r(8030).Z)("mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);function m(){let[e,t]=(0,l.useState)("");return(0,a.jsxs)("form",{onSubmit:r=>{r.preventDefault(),e&&(window.open("https://blog.mehdio.com/subscribe?email=".concat(encodeURIComponent(e)),"_blank"),t(""))},className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(u,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-500"}),(0,a.jsx)("input",{type:"email",value:e,onChange:e=>t(e.target.value),placeholder:"[email protected]",required:!0,className:"h-9 w-48 rounded-full border border-neutral-700 bg-neutral-900 pl-9 pr-3 text-sm text-neutral-100 placeholder-neutral-500 outline-none transition-all focus:border-blog-yellow focus:ring-1 focus:ring-blog-yellow/50 md:w-56"})]}),(0,a.jsx)("button",{type:"submit",className:"h-9 rounded-full bg-gradient-to-r from-blog-yellow to-blog-coral px-4 text-sm font-medium text-neutral-900 transition-all hover:opacity-90",children:"Subscribe"})]})}function h(e){let{initialData:t}=e,[r,n]=(0,l.useState)("all"),[o,i]=(0,l.useState)(t),[u,h]=(0,l.useState)(!1),[x,f]=(0,l.useState)(1),p=Math.ceil((o.total||0)/12),b=async(e,t)=>{let r=new URLSearchParams({page:(e-1).toString(),limit:"12",source:t}),a=await fetch("/api/blog?".concat(r));if(!a.ok)throw Error("Failed to fetch data");return a.json()},g=(0,l.useCallback)(async e=>{if(e!==x&&!u){h(!0),f(e);try{let t=await b(e,r);i(t),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error("Error loading page:",e),f(x)}finally{h(!1)}}},[x,r,u]),v=(0,l.useCallback)(async e=>{if(e!==r){n(e),h(!0),f(1);try{let t=await b(1,e);i(t)}catch(e){console.error("Error filtering posts:",e)}finally{h(!1)}}},[r]),j=e=>{switch(e){case"all":default:return"All Posts";case"substack":return"Personal Blog";case"motherduck":return"MotherDuck"}};return(0,a.jsxs)("div",{className:"content-container m-auto",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-4 md:flex-row md:items-end md:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(s.D,{text:"Blog"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-neutral-400",children:"All my writings, from personal blog to technical articles. ✍️"})]}),(0,a.jsx)(m,{})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 border-b border-neutral-800 pb-4",children:["all","substack","motherduck"].map(e=>(0,a.jsx)("button",{onClick:()=>v(e),disabled:u,className:"cursor-pointer rounded-full px-5 py-2 text-sm font-medium transition-all duration-300 disabled:cursor-not-allowed disabled:opacity-50 ".concat(r===e?"bg-gradient-to-r from-blog-yellow to-blog-coral text-neutral-900":"border border-neutral-700 bg-transparent text-neutral-300 hover:border-blog-yellow hover:text-blog-yellow"),children:j(e)},e))}),(0,a.jsx)("div",{className:"min-h-[400px]",children:u?(0,a.jsx)("div",{className:"divide-y divide-neutral-800",children:Array.from({length:8}).map((e,t)=>(0,a.jsxs)("div",{className:"py-6",children:[(0,a.jsx)("div",{className:"mb-3 h-6 w-3/4 animate-pulse rounded bg-neutral-800"}),(0,a.jsx)("div",{className:"mb-3 h-4 w-full animate-pulse rounded bg-neutral-800/50"}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("div",{className:"h-3 w-24 animate-pulse rounded bg-neutral-800/30"}),(0,a.jsx)("div",{className:"h-3 w-20 animate-pulse rounded bg-neutral-800/30"})]})]},t))}):o.data.length>0?(0,a.jsx)("div",{children:o.data.map((e,t)=>(0,a.jsx)(c,{post:e},"".concat(e.source,"-").concat(e.id,"-").concat(t)))}):(0,a.jsx)("div",{className:"py-16 text-center text-neutral-500",children:"No posts found for the selected filter."})}),p>1&&(0,a.jsx)("div",{className:"mt-8 border-t border-neutral-800 pt-8",children:(0,a.jsx)(d.Z,{currentPage:x,totalPages:p,onPageChange:g,loading:u,totalItems:o.total,itemsPerPage:12})})]})}}
1,7730:function(e,t,r){"use strict";r.d(t,{default:function(){return n}});var a=r(7437),l=r(6648),s=r(2265);function n(e){let{src:t,alt:r,fallbackSrc:n="/assets/placeholder-image.svg",...o}=e,[i,c]=(0,s.useState)(t),[d,u]=(0,s.useState)(!1);return(0,a.jsx)(l.default,{...o,src:i,alt:r,onError:()=>{d||i===n||(u(!0),c(n))}})}},2869:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var a=r(7437),l=r(518),s=r(7592),n=r(2265),o=r(4839),i=r(6164);let c=n.forwardRef((e,t)=>{let{className:r,variant:l="default",size:s="default",...n}=e;return(0,a.jsx)("button",{className:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.m6)((0,o.W)(t))}("inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",{"bg-primary text-primary-foreground hover:bg-primary/90":"default"===l,"bg-destructive text-destructive-foreground hover:bg-destructive/90":"destructive"===l,"border-input hover:bg-accent hover:text-accent-foreground border":"outline"===l,"bg-secondary text-secondary-foreground hover:bg-secondary/80":"secondary"===l,"hover:bg-accent hover:text-accent-foreground":"ghost"===l,"text-primary underline-offset-4 hover:underline":"link"===l,"h-10 px-4 py-2":"default"===s,"h-9 rounded-md px-3":"sm"===s,"h-11 rounded-md px-8":"lg"===s,"h-10 w-10":"icon"===s},r),ref:t,...n})});function d(e){let{currentPage:t,totalPages:r,onPageChange:n,loading:o=!1,showInfo:i=!0,totalItems:d,itemsPerPage:u=9}=e,m=(()=>{let e=[],a=[];for(let a=Math.max(1,t-2);a<=Math.min(r,t+2);a++)e.push(a);return t-2>2?a.push(1,"..."):t-2==2&&a.push(1),a.push(...e),t+2<r-1?a.push("...",r):t+2===r-1&&a.push(r),a})();return r<=1?null:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c,{variant:"outline",size:"sm",onClick:()=>{t>1&&n(t-1)},disabled:1===t||o,className:"h-8 w-8 p-0",children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})}),m.map((e,r)=>(0,a.jsx)("div",{children:"..."===e?(0,a.jsx)("span",{className:"text-muted-foreground px-2 py-1 text-sm",children:"..."}):(0,a.jsx)(c,{variant:e===t?"default":"outline",size:"sm",onClick:()=>n(e),disabled:o,className:"h-8 min-w-8 ".concat(e===t?"bg-blue-600 text-white hover:bg-blue-700":""),children:e})},r)),(0,a.jsx)(c,{variant:"outline",size:"sm",onClick:()=>{t<r&&n(t+1)},disabled:t===r||o,className:"h-8 w-8 p-0",children:(0,a.jsx)(s.Z,{className:"h-4 w-4"})})]}),i&&d&&(0,a.jsxs)("div",{className:"text-muted-foreground text-sm",children:["Showing ",Math.min((t-1)*u+1,d)," -"," ",Math.min(t*u,d)," of ",d," ","items"]})]})}c.displayName="Button"},7714:function(e,t,r){"use strict";r.d(t,{D:function(){return l}});var a=r(7437);function l(e){let{text:t,description:r,...l}=e;return(0,a.jsxs)("div",{className:"flex flex-col items-center md:items-start",children:[(0,a.jsx)("h1",{...l,className:"w-fit bg-gradient-to-br from-neutral-900 via-neutral-900/90 to-neutral-900/70 bg-clip-text text-4xl font-semibold text-transparent dark:from-neutral-300 dark:via-neutral-300/90 dark:to-neutral-300/70",children:t}),r&&(0,a.jsx)("span",{className:"text-xs text-neutral-400 dark:text-neutral-600",children:r})]})}}},function(e){e.O(0,[231,173,819,661,971,23,744],function(){return e(e.s=5146)}),_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.