PageSourceSearch

https://vatdi.com/build/assets/CaseStudies-ERNsIJlI.js

js vatdi.com collected 2026-10-02 06:29:09 UTC 3,569 bytes, 1 lines download raw bytes

1import{u as x,j as s}from"./react-CgBY0Ze-.js";import{P as h}from"./PageHeader-B2uLUomX.js";import{u,D as b}from"./useDataTable-BKIraTgq.js";import{d as f,b as N,O as c}from"./main-Cyy5nyiT.js";import{b1 as y,V as g,bl as j,af as v,bh as k,bo as w,z as C,T as _}from"./vendor-NlgW4Nml.js";import"./renderIcon-CWUPWWi0.js";import"./Pagination-DV0ATNcS.js";import"./EmptyState-CjfARjZz.js";import"./http-BCn5QfZZ.js";function V(){const a=x(),d=f(),l=N(),t=u({fetchFn:e=>c.content.stories.list(e)}),r=t.stats||{},m=async e=>{var n,o;if(await d({title:`Delete ${e.customer_name}'s story?`,message:"The page and its URL go for good.",confirmText:"Delete",confirmVariant:"danger"}))try{await c.content.stories.delete(e.id),l.success("Deleted."),t.refresh()}catch(i){l.error(((o=(n=i==null?void 0:i.response)==null?void 0:n.data)==null?void 0:o.message)||"Could not delete.")}},p=[{key:"customer_name",label:"Store",sortable:!1,className:"w-[40%]",render:e=>s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"font-medium text-gray-900 truncate",children:[e.customer_name," ",s.jsxs("span",{className:"text-gray-400 font-normal",children:["· ",e.platform]})]}),s.jsx("div",{className:"text-xs text-gray-500 truncate",title:e.hero_headline,children:e.hero_headline})]})},{key:"approval",label:"Approval",className:"w-[24%]",render:e=>e.approved_by?s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-emerald-700",children:[s.jsx(v,{className:"w-3.5 h-3.5"})," ",e.approved_by,e.approved_on?`, ${new Date(e.approved_on).toLocaleDateString()}`:""]}):s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-amber-700",children:[s.jsx(k,{className:"w-3.5 h-3.5"})," not recorded, cannot publish"]})},{key:"is_published",label:"State",className:"w-[12%]",render:e=>e.is_published?s.jsx("span",{className:"text-xs rounded-full bg-emerald-50 text-emerald-700 px-2 py-0.5",children:"live"}):s.jsx("span",{className:"text-xs rounded-full bg-gray-100 text-gray-600 px-2 py-0.5",children:"draft"})},{key:"actions",label:"",className:"w-[14%] text-right",render:e=>s.jsxs("div",{className:"flex items-center justify-end gap-0.5",onClick:n=>n.stopPropagation(),children:[s.jsx("button",{className:"btn-icon",title:"Edit",onClick:()=>a(`/admin/content/stories/${e.id}/edit`),children:s.jsx(w,{className:"w-4 h-4"})}),e.is_published&&s.jsx("a",{className:"btn-icon",title:"Open",href:`/case-studies/${e.slug}`,target:"_blank",rel:"noopener noreferrer",children:s.jsx(C,{className:"w-4 h-4"})}),s.jsx("button",{className:"btn-icon-danger",title:"Delete",onClick:()=>m(e),children:s.jsx(_,{className:"w-4 h-4"})})]})}];return s.jsxs("div",{className:"space-y-6",children:[s.jsx(h,{title:"Customer stories",description:`${r.published??0} live, ${r.draft??0} in draft. A story publishes only once you record who approved the exact text and when.`,icon:s.jsx(g,{className:"w-5 h-5"}),iconAccent:"emerald",actions:[{label:"View stories",icon:y,onClick:()=>window.open("/case-studies","_blank","noopener")}],action:{label:"New story",onClick:()=>a("/admin/content/stories/create")}}),s.jsxs("div",{className:"card p-4",children:[s.jsx("input",{type:"text",placeholder:"Search store or headline…",value:t.search,onChange:e=>t.setSearch(e.target.value),className:"input w-72 max-w-full mb-4"}),s.jsx(b,{columns:p,table:t,tableClassName:"table-fixed",onRowClick:e=>a(`/admin/content/stories/${e.id}/edit`),emptyTitle:"No stories yet",emptyAction:{label:"New story",icon:j,onClick:()=>a("/admin/content/stories/create")}})]})]})}export{V 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.