1import{e as g,a as v,u as S,r as i,j as e}from"./index-DMTSLr9O.js";import{T as D}from"./TiptapEditor-B3P-sO-K.js";import{L as p}from"./LMSLayout-DVcuaCDx.js";/* empty css */import"./index-BmbtWtbg.js";import"./config-pocBRGU-.js";import"./LMSSidebar-DvoCer1q.js";const L=()=>{const{noteId:o}=g(),x=v(),{t:a}=S(),[t,r]=i.useState(null),[s,l]=i.useState(!1),[m,c]=i.useState(""),[h,d]=i.useState("");i.useEffect(()=>{if(o){const n={id:o,title:o.replace(/-/g," ").replace(/\b\w/g,N=>N.toUpperCase()),content:"",createdDate:new Date().toISOString().split("T")[0],modifiedDate:new Date().toISOString().split("T")[0]};r(n),c(n.title),d(n.content)}},[o]);const u=()=>{if(t){const n={...t,title:m,content:h,modifiedDate:new Date().toISOString().split("T")[0]};r(n),l(!1)}},j=()=>{t&&(c(t.title),d(t.content),l(!1))},f=()=>{window.confirm("ì ë§ë¡ ì´ ë
¸í¸ë¥¼ ìì íìê² ìµëê¹?")&&x("/lms/home")};return t?e.jsxs(p,{children:[e.jsxs("div",{className:"note-header",children:[e.jsxs("div",{className:"note-title-section",children:[s?e.jsx("input",{type:"text",value:m,onChange:n=>c(n.target.value),className:"note-title-input",placeholder:"ë
¸í¸ ì 목"}):e.jsx("h1",{className:"note-title",children:t.title}),e.jsxs("div",{className:"note-meta",children:[e.jsxs("span",{children:["ìì±: ",t.createdDate]}),t.modifiedDate!==t.createdDate&&e.jsxs("span",{children:["ìì : ",t.modifiedDate]})]})]}),e.jsx("div",{className:"note-actions",children:s?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:u,className:"save-btn",children:a("ì ì¥")}),e.jsx("button",{onClick:j,className:"cancel-btn",children:a("ì·¨ì")})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>l(!0),className:"edit-btn",children:a("í¸ì§")}),e.jsx("button",{onClick:f,className:"delete-btn",children:a("ìì ")})]})})]}),e.jsx("div",{className:"note-content",children:e.jsx(D,{content:s?h:t.content,onChange:n=>{s&&d(n)},placeholder:s?"ë
¸í¸ ë´ì©ì ìì±íì¸ì...":"",editable:s,minHeight:"300px"})})]}):e.jsx(p,{children:e.jsx("div",{className:"note-loading",children:e.jsx("p",{children:a("ë
¸í¸ë¥¼ ë¶ë¬ì¤ë ì¤...")})})})};export{L 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.