-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-notice-tsx-e0a28c02d7f116d8798b.js
2 lines (2 loc) · 2 KB
/
component---src-pages-notice-tsx-e0a28c02d7f116d8798b.js
1
2
"use strict";(self.webpackChunk_portfolio_blog=self.webpackChunk_portfolio_blog||[]).push([[180],{6364:function(e,t,s){s.r(t);var r=s(1004),a=s(9052),n=s(5668),l=s(9296),i=s(6252),o=s(8440),u=s(7e3);const d=(0,r.c)("section",{target:"eg9f47t0"})({name:"167j9n6",styles:"margin:0 auto;width:100%;max-width:900px;padding:2rem"});t.default=e=>{const{data:t}=e,{nodes:s}=t.allMarkdownRemark,{0:r,1:m}=(0,n.useState)(""),c=(0,n.useMemo)((()=>(0,o.iw)(s).sort(((e,t)=>{const s=(0,o._I)(e.frontmatter.date);return(0,o._I)(t.frontmatter.date).getTime()-s.getTime()}))),[s]),h=(0,n.useMemo)((()=>c.map((e=>{const{slug:t}=e.fields,{date:s,title:r}=e.frontmatter,[,a,n]=(0,o.HI)(s);return{time:(0,o._I)(s).getTime(),date:Number(a)+"월 "+Number(n)+"일",name:r,slug:t}}))),[c]),g=(0,n.useMemo)((()=>{const e=c.reduce(((e,t)=>{const{slug:s}=t.fields,{date:r,title:a}=t.frontmatter,[n,l,i]=(0,o.HI)(r);return e[n]||(e[n]=[]),e[n].push({name:a,date:Number(l)+"월 "+Number(i)+"일",slug:s}),e}),{}),t=Object.values(e);return Object.keys(e).map(((e,s)=>({year:e,posts:t[s]}))).sort(((e,t)=>Number(t.year)-Number(e.year)))}),[s]),j=(0,n.useMemo)((()=>h.filter((e=>e.name.toLocaleUpperCase().includes(r.toLocaleUpperCase())))),[h,r]),p=0!==r.length;return(0,u.jsxs)(a.q4,{children:[(0,u.jsx)(i.y,{name:"공지사항 목록"}),(0,u.jsxs)(d,{children:[(0,u.jsxs)(a.q4,{children:[(0,u.jsx)("div",{children:(0,u.jsx)(a.U1,{value:r,onChange:m,size:"large",placeholder:"검색할 텍스트를 입력하세요."})}),(0,u.jsx)(a.SU,{y:2})]}),p?0===j.length?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a.a,{size:20,weight:600,children:"검색된 결과가 없어요 :("}),(0,u.jsx)(a.a,{size:20,weight:600,children:"다른 결과를 검색해보시겠어요?"})]}):(0,u.jsx)(l.e,{underline:!0,title:"검색결과",list:j}):g.map((e=>(0,u.jsxs)(a.q4,{children:[(0,u.jsx)("div",{children:(0,u.jsx)(l.e,{title:e.year,list:e.posts,underline:!0})}),(0,u.jsx)(a.SU,{y:2})]},e.year)))]})]})}}}]);
//# sourceMappingURL=component---src-pages-notice-tsx-e0a28c02d7f116d8798b.js.map