1import{u as h,R as i,a as y,b as w,c as S,r as u,j as e}from"./index-laR2Tkne.js";function C({children:a}){const{isLoading:r,isAuthenticated:o}=h();return r||!o?null:i.createElement(i.Fragment,null,a)}function E({children:a}){const{isLoading:r,isAuthenticated:o}=h();return r||o?null:i.createElement(i.Fragment,null,a)}function R({children:a}){const{isLoading:r}=h();return r?i.createElement(i.Fragment,null,a):null}const F=function(){const r=y(),o=w(S.reports.create),[c,g]=u.useState(""),[x,p]=u.useState(!1),[f,j]=u.useState(""),N=n=>{const t=n.trim().split(` 2`),l=t.find(s=>s.startsWith("# "));if(!l)throw new Error("Report must start with a heading (# Title)");const d=l.replace(/^#\s+/,"").trim();let m="",b=!1;for(let s=0;s<t.length;s++){if(t[s].startsWith("# ")){b=!0;continue}if(b&&t[s].trim()&&!t[s].startsWith("#")){m=t[s].trim();break}}if(!m)throw new Error("Report must have a description paragraph after the title");return{title:d,description:m,content:n}},v=async n=>{n.preventDefault(),j(""),p(!0);try{const{title:t,description:l,content:d}=N(c);await o({title:t,description:l,content:d}),r({to:"/reports"})}catch(t){j(t instanceof Error?t.message:"Failed to submit report")}finally{p(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(R,{children:e.jsx("div",{className:"flex justify-center items-center min-h-[60vh]",children:e.jsx("span",{className:"loading loading-spinner loading-lg"})})}),e.jsx(E,{children:e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh] text-center",children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Sign in to Share Your Experience"}),e.jsx("p",{className:"text-base-content/70 mb-6",children:"Join the Code Bloom community to share your Claude Code experiences"}),e.jsx("button",{onClick:()=>void r({to:"/"}),className:"btn btn-primary",children:"Go to Home"})]})}),e.jsx(C,{children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Share Your Experience"}),e.jsx("p",{className:"text-base-content/70 mb-8",children:"Help others learn from your Claude Code session"}),e.jsxs("form",{onSubmit:n=>void v(n),className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"label",children:e.jsx("span",{className:"label-text",children:"Your Report (Markdown)"})}),e.jsx("textarea",{value:c,onChange:n=>g(n.target.value),className:"textarea textarea-bordered w-full h-96 font-mono text-sm",placeholder:`# Your main takeaway or learning 3 4Brief description of what happened during your Claude Code session... 5 6## More details...`,required:!0})]}),e.jsx("div",{className:"card bg-base-200",children:e.jsxs("div",{className:"card-body",children:[e.jsx("h3",{className:"card-title mt-0",children:"Report Format"}),e.jsx("div",{className:"prose prose-sm max-w-none",children:e.jsxs("ul",{children:[e.jsxs("li",{children:["Start with a heading: ",e.jsx("code",{children:"# Your Main Learning or Takeaway"})]}),e.jsx("li",{children:"First paragraph: Brief description of what happened and why you learned this"}),e.jsx("li",{children:"Rest of report: Detailed explanation of your experience"})]})})]})}),f&&e.jsx("div",{role:"alert",className:"alert alert-error",children:e.jsx("span",{children:f})}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("button",{type:"submit",disabled:x||!c.trim(),className:"btn btn-primary",children:x?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"loading loading-spinner"}),"Submitting..."]}):"Submit Report"}),e.jsx("button",{type:"button",onClick:()=>void r({to:"/reports"}),className:"btn btn-ghost",children:"Cancel"})]})]})]})})]})};export{F 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.