1import{b4 as _,u as d,aw as l,j as t,b5 as g,b6 as p}from"./index-tFdxgtTe.js";import{u as x}from"./useQuery-RGQ5_dN-.js";import{u as n}from"./useServerFn-zsMi7P__.js";import{P as h}from"./PostForm-BZo68d-K.js";function j(){const{id:i}=_.useParams(),o=n(p),s=n(g),m=d(),u=l(),{data:e,isLoading:c,error:r}=x({queryKey:["admin","blog","post",i],queryFn:()=>o({data:{id:i}})});return c?t.jsx("main",{className:"p-12 text-sm text-muted-foreground",children:"Loadingâ¦"}):r||!e?t.jsx("main",{className:"p-12 text-sm text-destructive",children:r?.message??"Not found"}):t.jsx("main",{className:"min-h-screen bg-background px-6 py-12",children:t.jsxs("div",{className:"mx-auto max-w-3xl",children:[t.jsx("h1",{className:"mb-8 text-2xl font-semibold tracking-tight",children:"Edit post"}),t.jsx(h,{submitLabel:"Update",initial:{slug:e.slug,title:e.title,meta_description:e.meta_description??"",category:e.category,excerpt:e.excerpt,cover_image_url:e.cover_image_url??"",image_caption:e.image_caption??"",content_html:e.content_html,read_time_minutes:e.read_time_minutes,status:e.status,author:e.author,author_role:e.author_role??"",author_url:e.author_url??"",author_affiliation:e.author_affiliation??"",reviewer_name:e.reviewer_name??"",reviewer_role:e.reviewer_role??"",dispatch_number:e.dispatch_number??"",article_type:e.article_type??"",doi:e.doi??"",key_question:e.key_question??"",key_findings:e.key_findings??"",key_clinical_meaning:e.key_clinical_meaning??"",references_json:e.references_json??[]},onSubmit:async a=>{await s({data:{id:i,...a,meta_description:a.meta_description||void 0,cover_image_url:a.cover_image_url||void 0,image_caption:a.image_caption||void 0}}),u.invalidateQueries({queryKey:["admin","blog"]}),m({to:"/admin/blog"})}})]})})}export{j as component};
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.