PageSourceSearch

https://demotelemed.lovable.app/assets/Seo-BOavcMAZ.js

js demotelemed.lovable.app collected 2026-10-03 03:25:59 UTC 7,624 bytes, 1 lines download raw bytes

1import{K as k,r as m,j as e,v as x,q as h}from"./index-42OYDF60.js";import{u as w}from"./useMutation-TEeOEsok.js";import{a as E}from"./usePageSeo-BJOptz5i.js";import{B as o}from"./button-EfpS49lo.js";import{I as l}from"./input-D0IjS33j.js";import{T as L}from"./textarea-D06DcQsJ.js";import{L as i}from"./label-BNvpn1fK.js";import{S as O}from"./switch-CrYu0Slx.js";import{C as q}from"./card-4WvPeLS0.js";import{e as D,f as P,i as T,j as I,k as K}from"./dialog-BPqr1XfL.js";import{P as Q}from"./plus-UlO-Lz9K.js";import{S as R}from"./search-C7Y2SfZe.js";import{E as A}from"./external-link-CXhpZ2p_.js";import{P as F}from"./pencil-DccT4vhR.js";import{T as U}from"./trash-2-B3_ksNI2.js";import"./index-CXOUwLiy.js";const z={path:"",label:"",title:"",description:"",keywords:"",canonical:"",og_image:"",og_type:"website",noindex:!1},ie=()=>{var v,N;const c=k(),{data:C=[],isLoading:u}=E(),[d,_]=m.useState(""),[a,t]=m.useState(null),[p,g]=m.useState(!1),j=w({mutationFn:async s=>{var y,b;const n={path:(y=s.path)==null?void 0:y.trim(),label:((b=s.label)==null?void 0:b.trim())||s.path,title:s.title||null,description:s.description||null,keywords:s.keywords||null,canonical:s.canonical||null,og_image:s.og_image||null,og_type:s.og_type||"website",noindex:!!s.noindex};if(s.id){const{error:r}=await x.from("page_seo").update(n).eq("id",s.id);if(r)throw r}else{const{error:r}=await x.from("page_seo").insert(n);if(r)throw r}},onSuccess:()=>{c.invalidateQueries({queryKey:["page_seo_all"]}),c.invalidateQueries({queryKey:["page_seo"]}),h.success("SEO সংরক্ষণ হয়েছে"),t(null)},onError:s=>h.error(s.message||"সংরক্ষণে সমস্যা")}),S=w({mutationFn:async s=>{const{error:n}=await x.from("page_seo").delete().eq("id",s);if(n)throw n},onSuccess:()=>{c.invalidateQueries({queryKey:["page_seo_all"]}),h.success("মুছে ফেলা হয়েছে")}}),f=C.filter(s=>!d||s.path.toLowerCase().includes(d.toLowerCase())||s.label.toLowerCase().includes(d.toLowerCase()));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"SEO ম্যানেজমেন্ট"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"প্রতিটি পেজের SEO টাইটেল, ডেসক্রিপশন, keywords, og-image ও noindex এখান থেকে সম্পূর্ণ কাস্টমাইজ করুন।"})]}),e.jsxs(o,{onClick:()=>{t({...z}),g(!0)},children:[e.jsx(Q,{className:"h-4 w-4"})," নতুন পেজ SEO"]})]}),e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(R,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(l,{value:d,onChange:s=>_(s.target.value),placeholder:"পেজ পাথ বা লেবেল খুঁজুন...",className:"pl-9"})]}),e.jsxs("div",{className:"grid gap-3",children:[u&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"লোড হচ্ছে..."}),f.map(s=>e.jsx(q,{className:"p-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-md bg-primary/10 px-2 py-0.5 text-xs font-mono text-primary",children:s.path}),e.jsx("span",{className:"text-sm font-semibold",children:s.label}),s.noindex&&e.jsx("span",{className:"rounded bg-destructive/10 px-2 py-0.5 text-[10px] font-bold text-destructive",children:"NOINDEX"}),e.jsx("a",{href:s.path,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground",children:e.jsx(A,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:s.title||e.jsx("span",{className:"text-muted-foreground italic",children:"no title"})}),e.jsx("div",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.description})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(o,{size:"sm",variant:"outline",onClick:()=>{t(s),g(!1)},children:[e.jsx(F,{className:"h-3.5 w-3.5"})," এডিট"]}),e.jsx(o,{size:"sm",variant:"outline",onClick:()=>{confirm("মুছবেন?")&&S.mutate(s.id)},children:e.jsx(U,{className:"h-3.5 w-3.5"})})]})]})},s.id)),!u&&f.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"কোন এন্ট্রি পাওয়া যায়নি।"})]}),e.jsx(D,{open:!!a,onOpenChange:s=>!s&&t(null),children:e.jsxs(P,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(T,{children:e.jsx(I,{children:p?"নতুন পেজ SEO":`SEO এডিট — ${a==null?void 0:a.path}`})}),a&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(i,{children:"পাথ (URL)"}),e.jsx(l,{value:a.path||"",onChange:s=>t({...a,path:s.target.value}),placeholder:"/about",disabled:!p})]}),e.jsxs("div",{children:[e.jsx(i,{children:"লেবেল"}),e.jsx(l,{value:a.label||"",onChange:s=>t({...a,label:s.target.value}),placeholder:"About"})]})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["টাইটেল ",e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(recommended < 60 chars — ",((v=a.title)==null?void 0:v.length)||0,")"]})]}),e.jsx(l,{value:a.title||"",onChange:s=>t({...a,title:s.target.value})})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["মেটা ডেসক্রিপশন ",e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(recommended < 160 chars — ",((N=a.description)==null?void 0:N.length)||0,")"]})]}),e.jsx(L,{rows:3,value:a.description||"",onChange:s=>t({...a,description:s.target.value})})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["Keywords ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(কমা দিয়ে আলাদা)"})]}),e.jsx(l,{value:a.keywords||"",onChange:s=>t({...a,keywords:s.target.value}),placeholder:"telemedicine, doctor, bangladesh"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Canonical URL"}),e.jsx(l,{value:a.canonical||"",onChange:s=>t({...a,canonical:s.target.value}),placeholder:"https://..."})]}),e.jsxs("div",{children:[e.jsx(i,{children:"OG Type"}),e.jsx(l,{value:a.og_type||"",onChange:s=>t({...a,og_type:s.target.value}),placeholder:"website"})]})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["OG Image URL ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(1200×630 recommended)"})]}),e.jsx(l,{value:a.og_image||"",onChange:s=>t({...a,og_image:s.target.value}),placeholder:"https://..."}),a.og_image&&e.jsx("img",{src:a.og_image,alt:"og preview",className:"mt-2 max-h-40 rounded border"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold",children:"Noindex"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"এই পেজ সার্চ ইঞ্জিন থেকে লুকান"})]}),e.jsx(O,{checked:!!a.noindex,onCheckedChange:s=>t({...a,noindex:s})})]})]}),e.jsxs(K,{children:[e.jsx(o,{variant:"outline",onClick:()=>t(null),children:"বাতিল"}),e.jsx(o,{onClick:()=>a&&j.mutate(a),disabled:j.isPending||!(a!=null&&a.path),children:"সংরক্ষণ"})]})]})})]})};export{ie 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.