import{e as p,u as j,j as e,C as m,N as u,H as f,f as y,U as w,T as N,g as b,F as v,L as x}from"./index-BGTL91Ib.js";import{A as n}from"./AdSenseBlock-v14eGMFJ.js";const S=()=>{const{slug:d}=p(),{blogs:i,loading:g}=j(),s=i.find(t=>t.slug===d);if(g)return e.jsx(m,{className:"py-16 text-center",children:e.jsx("p",{className:"text-lg text-gray-600",children:"Loading post..."})});if(!s)return e.jsx(u,{to:"/404"});const o=i.filter(t=>t.id!==s.id&&t.status==="Published"&&t.tags.some(h=>s.tags.includes(h))).slice(0,3),a=`https://www.indsoftwork.in/blog/${s.slug}`,l=`${s.title} | IndSoftwork Blog`,r=s.metadescription||s.summary,c=s.image.startsWith("http")?s.image:`https://www.indsoftwork.in${s.image}`;return e.jsxs("div",{className:"bg-gray-50 pb-16",children:[e.jsxs(f,{children:[e.jsx("title",{children:l}),e.jsx("meta",{name:"description",content:r}),e.jsx("link",{rel:"canonical",href:a}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:url",content:a}),e.jsx("meta",{property:"og:title",content:l}),e.jsx("meta",{property:"og:description",content:r}),e.jsx("meta",{property:"og:image",content:c}),e.jsx("meta",{property:"og:image:width",content:"1200"}),e.jsx("meta",{property:"og:image:height",content:"630"}),e.jsx("meta",{name:"twitter:title",content:l}),e.jsx("meta",{name:"twitter:description",content:r}),e.jsx("meta",{name:"twitter:image",content:c}),e.jsx("meta",{property:"article:published_time",content:s.date}),e.jsx("meta",{property:"article:author",content:s.author}),s.tags.map(t=>e.jsx("meta",{property:"article:tag",content:t},t))]}),e.jsx("header",{className:"h-64 md:h-80 w-full bg-gray-200",children:e.jsx("img",{src:s.image,alt:s.title,className:"w-full h-full object-cover",fetchPriority:"high",width:"1200",height:"600"})}),e.jsx(m,{children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-6 md:p-8 lg:p-12 -mt-16 md:-mt-20 relative z-10",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-extrabold text-gray-900",children:s.title}),e.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-4 text-gray-500 text-sm",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(y,{className:"w-5 h-5"}),e.jsx("span",{children:new Date(s.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(w,{className:"w-5 h-5"}),e.jsxs("span",{children:["By ",s.author]})]})]})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-12",children:[e.jsxs("div",{className:"w-full lg:w-3/4",children:[e.jsx(n,{slot:"1234567890"}),e.jsx("article",{className:"prose prose-blue lg:prose-xl max-w-none prose-headings:text-gray-900 prose-p:text-gray-700 prose-li:text-gray-700",dangerouslySetInnerHTML:{__html:s.content}}),e.jsx("div",{className:"my-8",children:e.jsx(n,{slot:"1234567890"})}),e.jsx("div",{className:"mt-8 border-t pt-4",children:e.jsxs("div",{className:"flex items-center flex-wrap gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"w-5 h-5 text-gray-500"}),e.jsx("span",{className:"font-semibold",children:"Tags:"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.tags.map(t=>e.jsx("span",{className:"bg-yellow-100 text-yellow-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded-full",children:t},t))})]})}),e.jsx(n,{slot:"1234567890"})]}),e.jsx("aside",{className:"w-full lg:w-1/4 space-y-8",children:e.jsxs("div",{className:"bg-gray-100 p-6 rounded-lg border border-gray-200 sticky top-24",children:[e.jsxs("h3",{className:"text-lg font-bold mb-4 flex items-center gap-2",children:[e.jsx(b,{className:"w-6 h-6"})," Share This Post"]}),e.jsx("div",{className:"flex space-x-4",children:e.jsx("a",{href:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(a)}`,target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-blue-700",children:e.jsx(v,{className:"h-8 w-8"})})})]})})]}),o.length>0&&e.jsxs("div",{className:"mt-16 border-t pt-12",children:[e.jsx("h2",{className:"text-3xl font-bold mb-8 text-center",children:"Related Blogs"}),e.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:o.map(t=>e.jsxs("div",{className:"bg-white rounded-lg shadow-md overflow-hidden group",children:[e.jsx(x,{to:`/blog/${t.slug}`,children:e.jsx("img",{src:t.image,alt:t.title,className:"w-full h-40 object-cover group-hover:opacity-80 transition-opacity",loading:"lazy",width:"1200",height:"600",decoding:"async"})}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-lg font-bold mb-2",children:e.jsx(x,{to:`/blog/${t.slug}`,className:"hover:text-blue-600 transition-colors",children:t.title})}),e.jsxs("p",{className:"text-sm text-gray-500",children:[t.summary.substring(0,80),"..."]})]})]},t.id))})]})]})})]})};export{S as default};