PageSourceSearch

https://lms.gie.kr/assets/Favorites-BS9JM2Fm.js

js gie.kr collected 2026-10-06 12:42:52 UTC 5,325 bytes, 1 lines download raw bytes

1import{u as g,r as d,j as s}from"./index-DMTSLr9O.js";import{L as b}from"./LMSLayout-DVcuaCDx.js";/* empty css                   */import"./LMSSidebar-DvoCer1q.js";const I=()=>{const{t}=g(),[i,h]=d.useState([{id:1,name:"학습 자료",color:"#3b82f6",createdDate:"2024-03-01"},{id:2,name:"참고 링크",color:"#10b981",createdDate:"2024-03-05"},{id:3,name:"중요 문서",color:"#f59e0b",createdDate:"2024-03-10"}]),[a,p]=d.useState([{id:1,title:"Python 기초 강의 자료",url:"/lms/courses/1/lesson/5",type:"lesson",folderId:1,addedDate:"2024-03-12",description:"Python 변수와 데이터 타입에 대한 상세한 설명"},{id:2,title:"MDN Web Docs - JavaScript",url:"https://developer.mozilla.org/ko/docs/Web/JavaScript",type:"external",folderId:2,addedDate:"2024-03-11",description:"JavaScript 공식 문서 및 튜토리얼"},{id:3,title:"과제 제출 가이드",url:"/lms/guides/assignment-submission",type:"document",folderId:3,addedDate:"2024-03-10",description:"과제 제출 방법과 주의사항"},{id:4,title:"웹 개발 실습 페이지",url:"/lms/courses/2/practice",type:"page",folderId:null,addedDate:"2024-03-09",description:"HTML/CSS 실습을 위한 페이지"}]),[n,c]=d.useState(""),[j,o]=d.useState(!1),[r,x]=d.useState(null),u=()=>{if(n.trim()){const e={id:Date.now(),name:n,color:"#6366f1",createdDate:new Date().toISOString().split("T")[0]};h([...i,e]),c(""),o(!1)}},f=e=>{confirm("이 폴더를 삭제하시겠습니까? 폴더 안의 즐겨찾기는 미분류로 이동됩니다.")&&(h(i.filter(l=>
1l.id!==e)),p(a.map(l=>l.folderId===e?{...l,folderId:null}:l)))},N=e=>{p(a.filter(l=>l.id!==e))},v=e=>{switch(e){case"lesson":return"🎥";case"document":return"📄";case"page":return"📃";case"external":return"🔗";default:return"📌"}},m=r?a.filter(e=>e.folderId===r):a.filter(e=>e.folderId===null),y=e=>a.filter(l=>l.folderId===e).length;return s.jsx(b,{children:s.jsxs("div",{className:"lms-content-wrapper",children:[s.jsxs("div",{className:"favorites-header",children:[s.jsx("h1",{className:"page-title",children:t("즐겨찾기")}),s.jsx("p",{className:"page-subtitle",children:t("자주 사용하는 페이지와 학습 자료를 폴더별로 정리하세요")})]}),s.jsxs("div",{className:"favorites-content",children:[s.jsxs("div",{className:"folders-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{className:"section-title",children:t("폴더")}),s.jsxs("button",{className:"add-folder-btn",onClick:()=>o(!0),children:["+ ",t("폴더 추가")]})]}),j&&s.jsxs("div",{className:"new-folder-form",children:[s.jsx("input",{type:"text",placeholder:t("폴더 이름을 입력하세요"),value:n,onChange:e=>c(e.target.value),onKeyPress:e=>e.key==="Enter"&&u()}),s.jsx("button",{onClick:u,children:t("생성")}),s.jsx("button",{onClick:()=>{o(!1),c("")},children:t("취소")})]}),s.jsxs("div",{className:"folders-grid",children:[s.jsxs("div",{className:`folder-card ${r===null?"active":""}`,onClick:()=>x(null),children:[s.jsx("div",{className:"folder-icon",style:{color:"#64748b"},children:"📂"}),s.jsxs("div",{className:"folder-info",children:[s.jsx("h3",{className:"folder-name",children:t("미분류")}),s.jsxs("span",{className:"folder-count",children:[a.filter(e=>e.folderId===null).length,"개 항목"]})]})]}),i.map(e=>s.jsxs("div",{className:`folder-card ${r===e.id?"active":""}`,onClick:()=>x(e.id),children:[s.jsx("div",{className:"folder-icon",style:{color:e.color},children:"📁"}),s.jsxs("div",{className:"folder-info",children:[s.jsx("h3",{className:"folder-name",children:e.name}),s.jsxs("span",{className:"folder-count",children:[y(e.id),"개 항목"]})]}),s.jsx("button",{className:"delete-folder-btn",onClick:l=>{l.stopPropagation(),f(e.id)},children:"✕"})]},e.id))]})]}),s.jsxs("div",{className:"favorites-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{className:"section-title",children:r?i.find(e=>e.id===r)?.name||t("폴더"):t("미분류")}),s.jsxs("span",{className:"items-count",children:[m.length,"개 항목"]})]}),m.length===0?s.jsxs("div",{className:"empty-favorites",children:[s.jsx("div",{className:"empty-icon",children:"📌"}),s.jsx("h3",{children:t("즐겨찾기가 없습니다")}),s.jsx("p",{children:t("학습 중 유용한 페이지나 자료를 즐겨찾기에 추가하세요.")})]}):s.jsx("div",{className:"favorites-list",children:m.map(e=>s.jsxs("div",{className:"favorite-item",children:[s.jsx("div",{className:"favorite-icon",children:v(e.type)}),s.jsxs("div",{className:"favorite-content",children:[s.jsx("h3",{className:"favorite-title",children:s.jsx("a",{href:e.url,target:e.type==="external"?"_blank":"_self",rel:e.type==="external"?"noopener noreferrer":void 0,children:e.title})}),e.description&&s.jsx("p",{className:"favorite-description",children:e.description}),s.jsxs("div",{className:"favorite-meta",children:[s.jsxs("span",{className:"favorite-date",children:[t("추가일"),": ",e.addedDate]}),s.jsxs("span",{className:"favorite-type",children:[e.type==="lesson"&&t("강의"),e.type==="document"&&t("문서"),e.type==="page"&&t("페이지"),e.type==="external"&&t("외부링크")]})]})]}),s.jsx("button",{className:"remove-favorite-btn",onClick:()=>N(e.id),title:t("즐겨찾기 제거"),children:"✕"})]},e.id))})]})]})]})})};export{I 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.