PageSourceSearch

https://downundervisa.com/assets/new-CK9RaDiM.js

js downundervisa.com collected 2026-10-09 05:18:43 UTC 2,985 bytes, 1 lines download raw bytes

1import{u as y,r as s,j as e,bX as C}from"./main-Bo0oayNO.js";import{s as l}from"./index-ThM9GGfP.js";function D(){const n=y(),[a,g]=s.useState(""),[c,o]=s.useState(""),[d,p]=s.useState(""),[u,b]=s.useState("draft"),[m,x]=s.useState(!1),[h,i]=s.useState(null),[f,j]=s.useState(!0),N=t=>{g(t),f&&o(l(t))},S=t=>{j(!1),o(l(t))},v=async t=>{if(t.preventDefault(),!a.trim()){i("Title is required");return}x(!0),i(null);try{const r=await C({data:{title:a.trim(),slug:c||l(a),description:d.trim()||void 0,status:u}});n({to:"/admin/series/$id",params:{id:r.id}})}catch(r){i(r instanceof Error?r.message:"Failed to create series")}finally{x(!1)}};return e.jsxs("div",{className:"max-w-2xl",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"New Series"}),e.jsx("p",{className:"text-gray-600",children:"Create a new content series to group related posts"})]}),h&&e.jsx("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg text-red-700",children:h}),e.jsxs("form",{onSubmit:v,className:"card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700 mb-1",children:"Title *"}),e.jsx("input",{id:"title",type:"text",value:a,onChange:t=>N(t.target.value),className:"input",placeholder:"e.g., Getting Started with React",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"slug",className:"block text-sm font-medium text-gray-700 mb-1",children:"Slug"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-gray-500",children:"/series/"}),e.jsx("input",{id:"slug",type:"text",value:c,onChange:t=>S(t.target.value),className:"input flex-1",placeholder:"getting-started-with-react"})]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Auto-generated from title. Edit to customize."})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),e.jsx("textarea",{id:"description",value:d,onChange:t=>p(t.target.value),rows:3,className:"input",placeholder:"A brief description of this series..."})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"status",className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),e.jsxs("select",{id:"status",value:u,onChange:t=>b(t.target.value),className:"input",children:[e.jsx("option",{value:"draft",children:"Draft"}),e.jsx("option",{value:"published",children:"Published"})]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Draft series won't appear on the frontend"})]}),e.jsxs("div",{className:"flex gap-4 pt-4 border-t",children:[e.jsx("button",{type:"submit",disabled:m,className:"btn-primary",children:m?"Creating...":"Create Series"}),e.jsx("button",{type:"button",onClick:()=>n({to:"/admin/series",search:{status:"all",page:1,search:""}}),className:"btn-secondary",children:"Cancel"})]})]})]})}export{D 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.