PageSourceSearch

https://delphigrc.org/assets/AdminResearch-DZTNxMbC.js

js delphigrc.org collected 2026-10-04 00:27:14 UTC 7,017 bytes, 1 lines download raw bytes

1import{r as e,j as s}from"./vendor-react-BH6F5oQJ.js";import{A as a}from"./AdminLayout-CKCESQT6.js";import{L as t}from"./LazyRichTextEditor-ByQjI7gT.js";import{H as r,f as i,C as n,M as d,N as l,O as c,m as o,G as m,F as h,s as x}from"./index-dRqPaCFl.js";import{L as g}from"./label-RVODh2pd.js";import{T as p,a as u,b as j,c as f}from"./tabs-Bc5GG4D6.js";import{u as y}from"./usePages-B42aSg8W.js";import{b as v}from"./vendor-icons-CaI5__By.js";import"./vendor-ui-B4WC06Sp.js";import"./separator-KtQ1mSuG.js";import"./index-CCdGLatk.js";import"./Combination-DzDAyqvK.js";import"./vendor-supabase-COwyE4EW.js";import"./index-B3FPD4RS.js";import"./en-US-DUAJ-5Wt.js";import"./vendor-query-CC4VRGyP.js";import"./index-D5Ei2fSx.js";const b=()=>{const{getPageBySlug:b,updatePage:N,loading:w}=y(),[C,I]=e.useState(null),[S,k]=e.useState(""),[M,P]=e.useState(!1),[L,U]=e.useState({title:"",description:"",keywords:"",ogImage:""});e.useEffect(()=>{E()},[]);const E=async()=>{const e=await b("research");if(e&&(I(e),e.content&&"object"==typeof e.content&&!Array.isArray(e.content))){const s=e.content;if(s.html&&k(s.html),s.meta){const e=s.meta;U({title:(null==e?void 0:e.title)||"",description:(null==e?void 0:e.description)||"",keywords:(null==e?void 0:e.keywords)||"",ogImage:(null==e?void 0:e.ogImage)||""})}}};return w?s.jsx("div",{className:"flex h-screen items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})}):s.jsxs(a,{children:[s.jsxs(r,{children:[s.jsx("meta",{name:"robots",content:"noindex,nofollow"}),s.jsx("title",{children:"Research Page Management - Admin - Delphi Global Research Center"})]}),s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"max-w-7xl mx-auto",children:[s.jsxs("div",{className:"mb-8 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"mb-2 font-heading text-3xl font-bold text-foreground",children:"Research Page Management"}),s.jsx("p",{className:"text-muted-foreground",children:"Edit the Research page content, layout, and SEO settings"})]}),s.jsxs(i,{onClick:async()=>{if(!C)return;const e=await N(C.id,{content:{html:S,meta:L}});e&&(I(e),h.success("Research page updated successfully"))},children:[s.jsx(v,{className:"mr-2 h-4 w-4"}),"Save Changes"]})]}),s.jsxs(p,{defaultValue:"content",className:"space-y-6",children:[s.jsxs(u,{children:[s.jsx(j,{value:"content",children:"Content"}),s.jsx(j,{value:"images",children:"Images"}),s.jsx(j,{value:"seo",children:"SEO & Meta Tags"})]}),s.jsx(f,{value:"content",className:"space-y-4",children:s.jsxs(n,{children:[s.jsxs(d,{children:[s.jsx(l,{children:"Page Content"}),s.jsx(c,{children:"Use the rich text editor to create and format your research page content"})]}),s.jsx(o,{children:s.jsx("div",{className:"rounded-lg border border-border bg-card",children:s.jsx(t,{content:S,onChange:k,placeholder:"Compose research overview..."})})})]})}),s.jsx(f,{value:"images",className:"space-y-4",children:s.jsxs(n,{children:[s.jsxs(d,{children:[s.jsx(l,{children:"Image Management"}),s.jsx(c,{children:"Upload and manage images for your research page"})]}),s.jsxs(o,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(g,{htmlFor:"image-upload",children:"Upload Image"}),s.jsxs("div",{className:"mt-2 flex items-center gap-4",children:[s.jsx(m,{id:"image-upload",type:"file",accept:"image/*",onChange:async e=>{var s;const a=null==(s=e.target.files)?void 0:s[0];if(!a)return;const t=await(async e=>{try{P(!0);const s=e.name.split(".").pop(),a=`${Math.random()}.${s}`,{error:t}=await x.storage.from("article-images").upload(a,e);if(t)throw t;const{data:{publicUrl:r}}=x.storage.from("article-images").getPublicUrl(a);return h.success("Image uploaded successfully"),r}catch(s){return h.error(s instanceof Error?s.message:"Failed to upload image"),null}finally{P(!1)}})(a);if(t){k(S+`<img src="${t}" alt="Uploaded image" style="max-width: 100%;" />`)}},disabled:M,className:"flex-1"}),M&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"}),"Uploading..."]})]}),s.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Supported formats: JPG, PNG, GIF, WebP. Max size: 5MB"})]}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h3",{className:"text-sm font-medium mb-2",children:"Grid Layout Options"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Use HTML grid classes in the editor to create custom layouts:"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx("code",{className:"block bg-muted p-2 rounded",children:'<div class="grid grid-cols-2 gap-4">...</div>'}),s.jsx("code",{className:"block bg-muted p-2 rounded",children:'<div class="grid grid-cols-3 gap-6">...</div>'}),s.jsx("code",{className:"block bg-muted p-2 rounded",children:'<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-4">...</div>'})]})]})]})]})}),s.jsx(f,{value:"seo",className:"space-y-4",children:s.jsxs(n,{children:[s.jsxs(d,{children:[s.jsx(l,{children:"SEO Settings"}),s.jsx(c,{children:"Configure meta tags for better search engine visibility"})]}),s.jsxs(o,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(g,{htmlFor:"meta-title",children:"Page Title"}),s.jsx(m,{id:"meta-title",value:L.title,onChange:e=>U({...L,title:e.target.value}),placeholder:"Research | Delphi Group",maxLength:60}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[L.title.length,"/60 characters (recommended: 50-60)"]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(g,{htmlFor:"meta-description",children:"Meta Description"}),s.jsx(m,{id:"meta-description",value:L.description,onChange:e=>U({...L,description:e.target.value}),placeholder:"In-depth analysis and research on Eurasian security and regional dynamics",maxLength:160}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[L.description.length,"/160 characters (recommended: 120-160)"]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(g,{htmlFor:"meta-keywords",children:"Keywords"}),s.jsx(m,{id:"meta-keywords",value:L.keywords,onChange:e=>U({...L,keywords:e.target.value}),placeholder:"research, analysis, eurasia, regional dynamics, security"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keywords for SEO"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(g,{htmlFor:"og-image",children:"Open Graph Image URL"}),s.jsx(m,{id:"og-image",value:L.ogImage,onChange:e=>U({...L,ogImage:e.target.value}),placeholder:"https://example.com/image.jpg"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Image displayed when sharing on social media (1200x630px recommended)"})]})]})]})})]})]})})]})};export{b 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.