// pns-case-page.jsx — case study detail page + structured data const { useState: useCaseState, useEffect: useCaseEffect } = React; const CT = window.PNST; const CASES_DB = window.PNS_CASES || {}; const CASE_ORDER = window.PNS_CASE_ORDER || Object.keys(CASES_DB); const C_SITE = (window.pnsWP && window.pnsWP.siteUrl) || ''; const cImg = (id, w) => (window.pnsWP?.images?.[id]) || `https://images.unsplash.com/photo-${id}?w=${w}&auto=format&fit=crop&q=80`; const cUrl = (slug) => C_SITE ? `${C_SITE}case-studies/${slug}/` : `case-study.html?id=${slug}`; const cPage = (slug) => C_SITE ? `${C_SITE}${slug}/` : ({services:'Services.html',portfolio:'Portfolio.html',contact:'Contact.html',pricing:'Pricing.html'})[slug]; const cService = (id) => (window.pnsWP?.serviceUrls?.[id]) || ((window.pnsWP?.serviceUrl || 'service.html') + '?id=' + id); const CASE_SLUG = (() => { if (window.PNS_CASE_SLUG && CASES_DB[window.PNS_CASE_SLUG]) return window.PNS_CASE_SLUG; const q = new URLSearchParams(window.location.search).get('id'); if (q && CASES_DB[q]) return q; const seg = window.location.pathname.split('/').filter(Boolean).pop(); if (seg && CASES_DB[seg]) return seg; return CASE_ORDER[0]; })(); /* ── Structured data: Article + FAQPage + BreadcrumbList ────────── */ function injectCaseSchema(slug, cs) { const url = cUrl(slug); const base = C_SITE || ''; const graph = [ { '@type':'Article', headline: cs.title, description: cs.metaDesc, image: cImg(cs.heroImg, 1600), mainEntityOfPage: url, inLanguage:'en-US', keywords: cs.keywords, articleSection: cs.cat, author:{ '@type':'Organization', name:'Premier Network Solutions' }, publisher:{ '@type':'Organization', name:'Premier Network Solutions', url: base || undefined } }, { '@type':'BreadcrumbList', itemListElement:[ { '@type':'ListItem', position:1, name:'Home', item: base || '/' }, { '@type':'ListItem', position:2, name:'Case Studies', item: cPage('portfolio') }, { '@type':'ListItem', position:3, name: cs.title, item: url }, ]}, { '@type':'FAQPage', mainEntity: cs.faqs.map(f => ({ '@type':'Question', name: f.q, acceptedAnswer:{ '@type':'Answer', text: f.a } })) }, ]; const prev = document.getElementById('pns-case-schema'); if (prev) prev.remove(); const el = document.createElement('script'); el.type = 'application/ld+json'; el.id = 'pns-case-schema'; el.textContent = JSON.stringify({ '@context':'https://schema.org', '@graph': graph }); document.head.appendChild(el); } function setMeta(name, content, attr) { if (!content) return; let el = document.head.querySelector(`meta[${attr||'name'}="${name}"]`); if (!el) { el = document.createElement('meta'); el.setAttribute(attr||'name', name); document.head.appendChild(el); } el.setAttribute('content', content); } /* ── Pieces ─────────────────────────────────────────────────────── */ function CaseBreadcrumb({ cs }) { const link = { fontFamily:CT.bd, fontSize:12.5, color:'rgba(255,255,255,0.55)', textDecoration:'none', whiteSpace:'nowrap' }; return ( ); } function CaseHero({ cs }) { return (
); } function CaseFacts({ cs }) { const rows = [ ['Industry', cs.client.industry], ['Scale', cs.client.size], ['Region', cs.client.region], ['Engagement', cs.client.engagement], ]; return (
{rows.map(([k,v]) => (
{k}
{v}
))}
); } function CaseProse({ cs }) { const h2 = { fontFamily:CT.hd, fontWeight:800, fontSize:'clamp(25px,3vw,38px)', color:CT.g900, letterSpacing:'-0.03em', lineHeight:1.14, margin:'0 0 22px', textWrap:'balance' }; const p = { fontFamily:CT.bd, fontSize:16, color:CT.g500, lineHeight:1.82, margin:'0 0 18px', textWrap:'pretty' }; return (

The Challenge

{cs.challenge.map((t,i) =>

{t}

)}
{cs.bodyAlt}

The Solution

{cs.solution.map((s,i) => (

{s.h}

{s.p}

))}
); } function CaseResults({ cs }) { return (
); } function CaseTech({ cs }) { return (

Technologies Deployed

); } function CaseFaqs({ cs }) { const [open, setOpen] = useCaseState(0); return (

Questions About This Project

{cs.faqs.map((f,i) => { const isOpen = open === i; return (
{isOpen && (

{f.a}

)}
); })}
); } const SERVICE_LABELS = { 'managed-it':'Managed IT Services','cybersecurity':'Cybersecurity','microsoft-365':'Microsoft 365', 'network-infrastructure':'Network Infrastructure','ai-solutions':'AI Solutions', 'backup-monitoring':'Backup & Monitoring','it-consulting':'IT Consulting', 'web-development':'Web Development','seo-services':'SEO Services', }; function CaseNext({ slug, cs }) { const others = CASE_ORDER.filter(s => s !== slug).slice(0,3); return (

Services Behind This Project

More Case Studies

{others.map(s => { const o = CASES_DB[s]; return ( {e.currentTarget.style.transform='translateY(-5px)'; e.currentTarget.style.boxShadow='0 18px 44px rgba(12,30,50,0.13)';}} onMouseLeave={e=>{e.currentTarget.style.transform='translateY(0)'; e.currentTarget.style.boxShadow='none';}}> {o.heroAlt}
{o.cat}

{o.title}

); })}
); } function CaseCTA() { return (

Facing something similar?

Tell us where your technology stands today. A senior engineer will walk through the options with you — no sales script.

Book a Consultation → Explore Our Services
); } /* ── Page ───────────────────────────────────────────────────────── */ function PNSCasePage() { const cs = CASES_DB[CASE_SLUG]; useCaseEffect(() => { if (!cs) return; document.title = cs.metaTitle; setMeta('description', cs.metaDesc); setMeta('keywords', cs.keywords); setMeta('og:title', cs.metaTitle, 'property'); setMeta('og:description', cs.metaDesc, 'property'); setMeta('og:type', 'article', 'property'); setMeta('og:image', cImg(cs.heroImg,1600), 'property'); setMeta('twitter:card', 'summary_large_image'); let link = document.head.querySelector('link[rel="canonical"]'); if (!link) { link = document.createElement('link'); link.rel = 'canonical'; document.head.appendChild(link); } link.href = cUrl(CASE_SLUG); injectCaseSchema(CASE_SLUG, cs); const timer = setTimeout(() => { const ob = new IntersectionObserver(es => es.forEach(e => { if (e.isIntersecting) { e.target.classList.add('visible'); ob.unobserve(e.target); } }), { threshold:0.12, rootMargin:'0px 0px -50px 0px' }); document.querySelectorAll('.pns-fade-up,.pns-slide-left,.pns-slide-right,.pns-zoom-in').forEach(el => ob.observe(el)); }, 250); return () => clearTimeout(timer); }, [cs]); const Nav = window.PNSNav, Footer = window.PNSFooter; if (!cs) return
Case study not found.
; return (
{Nav ?
); } ReactDOM.createRoot(document.getElementById('app')).render();