1import{j as e}from"./vendor-query-6hJe-_u2.js";import{e as C,u as F,r as l,L as h}from"./vendor-react-C0FiJME3.js";import{c as A,s as f,N as z,S as _,l as E,a as R,b as p,H as I,D as j,j as M,T as P,d as q,P as H,C as N,M as B,e as D,A as G,f as W,g as U,h as O,i as V,F as J}from"./index-CiNRwlWe.js";function c({className:a,...i}){return e.jsx("div",{className:A("animate-pulse rounded-md bg-muted",a),...i})}const Y=()=>{const{slug:a}=C(),i=F(),[t,g]=l.useState(null),[b,y]=l.useState([]),[v,o]=l.useState(!0),[w,m]=l.useState(!1),[k,S]=l.useState(a);a!==k&&(S(a),m(!1),o(!0),g(null));const L=l.useCallback(s=>s.replace(/href=["']https?:\/\/(?:www\.)?tasova\.gen\.tr\/([^"'#?]+?)\/?["']/gi,(n,r)=>`href="/rehber/${r.split("/").pop()}"`).replace(/(<a [^>]*href=["']\/rehber\/[^"']+["'][^>]*)\s+target=["'][^"']*["']/gi,"$1").replace(/(<a [^>]*href=["']\/rehber\/[^"']+["'][^>]*)\s+rel=["'][^"']*["']/gi,"$1"),[]),T=l.useCallback(s=>{const n=s.target.closest("a");if(!n)return;const r=n.getAttribute("href")||"";r.startsWith("/")&&!r.startsWith("//")&&!r.startsWith("/admin")&&(s.preventDefault(),i(r))},[i]);if(l.useEffect(()=>{a&&(o(!0),m(!1),(async()=>{const{data:s,error:n}=await f.from("guide_pages").select("*").eq("slug",a).eq("published",!0).maybeSingle();if(n||!s){m(!0),o(!1);return}g(s);const{data:r}=await f.from("guide_pages").select("id,title,slug,group_name,excerpt,content,updated_at").eq("group_name",s.group_name).neq("slug",a).eq("published",!0).order("sort_order").limit(6);y(r??[]),o(!1),window.scrollTo({top:0})})())},[a]),w)return e.jsx(z,{});const d=t?`${t.title} - ${_}`:`İlçe Rehberi - ${_}`,u=p(`/rehber/${a||""}/`),x=t?E(t.excerpt||R(t.content)||`${t.title} hakkında güncel bilgiler ve TaÅova ilçe rehberi içerikleri.`):"TaÅova ilçe rehberi, kurumlar, ulaÅım, köyler, turizm, saÄlık ve önemli telefon bilgileri.",$={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Ana Sayfa",item:p("/")},{"@type":"ListItem",position:2,name:"İlçe Rehberi",item:p("/rehber/tasova-genel-tanitim/")},{"@type":"ListItem",position:3,name:(t==null?void 0:t.title)||"Rehber",item:u}]};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs(I,{children:[e.jsx("title",{children:d}),e.jsx("meta",{name:"description",content:x}),e.jsx("link",{rel:"canonical",href:u}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:title",content:d}),e.jsx("meta",{property:"og:description",content:x}),e.jsx("meta",{property:"og:url",content:u}),e.jsx("meta",{property:"og:image",content:j}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:d}),e.jsx("meta",{name:"twitter:description",content:x}),e.jsx("meta",{name:"twitter:image",content:j}),e.jsx("script",{type:"application/ld+json",children:M($)})]}),e.jsx(P,{}),e.jsx(q,{}),e.jsx(H,{}),e.jsxs("div",{className:"container mx-auto px-4 py-6",children:[e.jsxs("nav",{className:"flex items-center flex-wrap gap-1 text-xs text-muted-foreground -mt-[15px] mb-[6px] md:mt-0 md:mb-4",children:[e.jsx(h,{to:"/",className:"hover:text-primary",children:"Ana Sayfa"}),e.jsx(N,{size:12}),e.jsx("span",{className:"hover:text-primary",children:"İlçe Rehberi"}),t&&e.jsxs(e.Fragment,{children:[e.jsx(N,{size:12}),e.jsx("span",{className:"text-foreground line-clamp-1",children:t.title})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_340px] gap-6",children:[e.jsx("article",{className:"min-w-0",children:v?e.jsxs("div",{className:"space-y-3",children:[e.jsx(c,{className:"h-8 w-2/3"}),e.jsx(c,{className:"h-4 w-full"}),e.jsx(c,{className:"h-4 w-full"}),e.jsx(c,{className:"h-64 w-full"})]}):t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-accent font-semibold uppercase tracking-wider mb-2",children:[e.jsx(B,{size:14}),t.group_name]}),e.jsx("h1",{className:"text-2xl md:text-4xl font-bold leading-tight text-foreground mb-4",style:{fontFamily:"'Merriweather', serif"},children:t.title}),t.content?e.jsx("div",{className:`prose prose-sm md:prose-base max-w-none text-foreground
1/90 leading-relaxed 2 [&_img]:rounded-lg [&_img]:my-3 [&_img]:max-w-full [&_img]:h-auto 3 [&_a]:text-accent [&_a]:underline hover:[&_a]:text-accent/80 4 [&_table]:w-full [&_table]:border [&_td]:border [&_td]:p-2 [&_th]:border [&_th]:p-2 [&_th]:bg-muted 5 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mt-6 [&_h2]:mb-2 6 [&_h3]:text-lg [&_h3]:font-bold [&_h3]:mt-4 [&_h3]:mb-2 7 [&_p]:mb-3 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 ${a==="koylerimiz"?"[&_ul]:columns-2 sm:[&_ul]:columns-3 md:[&_ul]:columns-4 [&_ul]:gap-x-6 [&_ul]:list-none [&_ul]:pl-0 [&_ul_li]:break-inside-avoid [&_ul_li]:mb-1.5 [&_ul_li]:py-1 [&_ul_li]:border-b [&_ul_li]:border-dashed [&_ul_li]:border-border/60":""}`,dangerouslySetInnerHTML:{__html:D(L(t.content))},onClick:T}):e.jsx("p",{className:"text-muted-foreground",children:"Bu sayfa için içerik henüz eklenmedi."}),e.jsx(G,{size:"billboard",slotId:"guide-mid",className:"my-8"}),b.length>0&&e.jsxs("section",{className:"mt-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-1 h-6 bg-accent rounded-full"}),e.jsx("h2",{className:"text-xl font-bold text-foreground",style:{fontFamily:"'Merriweather', serif"},children:t.group_name})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:b.map(s=>e.jsx(h,{to:`/rehber/${s.slug}`,className:"group block",children:e.jsx(W,{className:"h-full hover:shadow-md transition-shadow",children:e.jsx(U,{className:"p-3",children:e.jsx("h3",{className:"text-sm font-semibold leading-snug group-hover:text-accent transition-colors line-clamp-2",children:s.title})})})},s.id))})]}),e.jsxs("section",{className:"mt-10 pt-6 border-t",children:[e.jsx("h3",{className:"text-sm font-bold text-foreground mb-3",children:"Tüm Rehber Sayfaları"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:O.map(s=>e.jsx(h,{to:`/rehber/${s.slug}`,className:`text-xs px-3 py-1.5 rounded-full border transition-colors ${s.slug===a?"bg-accent text-accent-foreground border-accent":"bg-secondary hover:bg-accent hover:text-accent-foreground hover:border-accent"}`,children:s.label},s.slug))})]})]}):null}),e.jsx(V,{})]})]}),e.jsx(J,{})]})};export{Y as default};
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.