import{u as f,Q as g,ay as y,r as b,i as C,j as e,o as N,d as h,c as i,T as n,b as c,C as B,aL as k,aM as v,k as w,V as F,w as L,aN as P,a9 as I,U as R,W as S,a as M,n as _,Z as q,a6 as E,G as m,aq as A}from"../index.Crez7j-Y.bundle.js";import{B as G}from"./BoardAPIs.CPUVoL2H.bundle.js";import{u as H}from"./StorageAPIs.Dbq9bCDO.bundle.js";const T=(r,a="",t=!0,o)=>{const{getBoardDetailAPI:d}=G();return f({queryKey:g.noticeDetail(r,a,t),queryFn:()=>d(y.enum.notice,r,a,t),refetchOnWindowFocus:!1,...o})};var x={},Y=C;Object.defineProperty(x,"__esModule",{value:!0});var p=x.default=void 0,U=Y(b()),W=e;p=x.default=(0,U.default)((0,W.jsx)("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7zm-6 .67 2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt");function z({noticeDetail:r,isPending:a}){const t=N(),o=h.useRef(null),d=()=>{t(R.NOTICE_LIST)},{downloadFileAsync:l}=H(),j=(s,u)=>{l(s,u)};return h.useEffect(()=>{var s;if(r&&o.current){const u=(s=r.content)!=null?s:"";o.current.innerHTML=u}},[r==null?void 0:r.content]),e.jsxs(i,{display:"flex",flexDirection:"column",gap:2,children:[e.jsxs(n,{variant:"title",children:[r==null?void 0:r.title,a&&e.jsx(c,{height:50,width:"50%"})]}),e.jsxs(i,{display:"flex",gap:3,color:B,children:[a&&e.jsx(c,{width:"30%"}),e.jsx(n,{variant:"body",children:"조회수 ".concat((r==null?void 0:r.viewCnt)||0)}),e.jsx(n,{variant:"body",children:r==null?void 0:r.registerName}),e.jsx(n,{variant:"body",children:r&&k(r.registerYmdt).format("YYYY-MM-DD")})]}),e.jsx(v,{}),e.jsx(i,{ref:o,minHeight:"40dvh",sx:{"& *":{font:"revert",fontSize:"revert"}},borderBottom:"1px solid ".concat(w),children:a&&e.jsx(c,{variant:"rounded",height:"30vh"})}),r&&r.attachments.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(F,{disablePadding:!0,children:r.attachments.map(s=>e.jsxs(L,{sx:{px:0,gap:2,"&:hover":{backgroundColor:P,cursor:"pointer"}},onClick:()=>j(s.downloadFileUrl,s.fileName),children:[e.jsx(p,{color:"error"}),e.jsx(n,{variant:"body",children:s.fileName})]},s.downloadFileUrl))}),e.jsx(v,{})]}),e.jsx(i,{display:"flex",justifyContent:"flex-end",mb:{mobile:10,desktop:0},children:e.jsx(I,{variant:"outlined",color:"inherit",onClick:d,children:e.jsx(n,{variant:"button",children:"목록"})})})]})}function V(){const r=S()[0],a=r.get("articleNo")||"",t=r.get("password")||void 0,{data:o,isPending:d}=T(a,t),{isMobile:l}=M();return e.jsx(i,{component:"main",bgcolor:_,py:{desktop:8,mobile:0},children:e.jsxs(q,{bgcolor:E,borderRadius:2,p:{desktop:4,mobile:0},gap:2,children:[l&&e.jsx(m,{item:!0,mobile:12,children:e.jsx(A,{title:"공지사항"})}),e.jsx(m,{item:!0,desktop:12,mobile:11,mx:"auto",children:e.jsx(z,{noticeDetail:o,isPending:d})})]})})}export{V as default};