1import{M as I,C as j,a as k,d as c,u as y,r as n,N as A,b as r,F,j as a,T as v,ah as M,ai as l,aj as U,i as E}from"./index-de074bce.js";import{S as L}from"./easymde.min-1d08dbf6.js";import{A as V,L as w}from"./LoadingButton-210cd01f.js";import"./Button-ad5043f5.js";const O=()=>{const{id:u}=I(),m=j();k();const{specificPost:e,status:s,isLoading:p}=c(t=>t.userPosts),{user:g}=c(t=>t.auth),d=y(),[o,x]=n.useState(e==null?void 0:e.text),[T,S]=n.useState(e==null?void 0:e.title),[b,f]=n.useState(e==null?void 0:e.topic),[i,C]=n.useState(e==null?void 0:e.authorRaiting),h=1e3,N=n.useCallback(t=>{x(t)},[]),R=n.useMemo(()=>({autofocus:!0,spellChecker:!1,autosave:{enabled:!0,uniqueId:"demo",delay:h}}),[h]);return n.useEffect(()=>{g||m("/Profile"),d(A(u))},[u]),r(F,{children:[s&&a(V,{variant:"outlined",severity:"info",className:"mt-10",children:s}),e&&r("form",{className:"flex gap-5 flex-col mt-10",onSubmit:t=>t.preventDefault(),children:[a(v,{className:"w-full",label:"Title",defaultValue:`${e==null?void 0:e.title}`,variant:"outlined",onChange:t=>{S(t.target.value)}}),a(v,{className:"w-full",label:"Topic",defaultValue:`${e==null?void 0:e.topic}`,variant:"outlined",onChange:t=>{f(t.target.value)}}),r(M,{labelId:"your-mark",defaultValue:e==null?void 0:e.authorRaiting,value:i,onChange:t=>C(t.target.value),children:[a(l,{value:0,children:"0"}),a(l,{value:1,children:"1"}),a(l,{value:2,children:"2"}),a(l,{value:3,children:"3"}),a(l,{value:4,children:"4"}),a(l,{value:5,children:"5"}),a(l,{value:6,children:"6"}),a(l,{value:7,children:"7"}),a(l,{value:8,children:"8"}),a(l,{value:9,children:"9"}),a(l,{value:10,children:"10"})]}),a("div",{className:"h-[400px] mb-10",children:a(L,{value:o,onChange:N,options:R})}),a(w,{loading:p,variant:"outlined",onClick:()=>{d(U({postId:u,text:o,title:T,topic:b,authorRaiting:i}))},children:E.t("update")})]})]})};export{O 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.