1import{F as k,u as F,r as d,j as e,s as f}from"./index-lDdk2Pz_.js";import{B as i}from"./button-B-zdNG6v.js";import{L as C}from"./lexical-editor-DhjsxE_Q.js";import{L as S}from"./loader-circle-BAGBLkwM.js";import{A as j}from"./arrow-left-D2oKLxQR.js";import{U as E,C as L}from"./user-DBo2QboB.js";import{P as m}from"./paperclip-COacAND1.js";import{D as R}from"./download-C4TSPWkV.js";import"./Combination-BmC-VOIE.js";import"./createLucideIcon-Dokxqcjj.js";const U={NOTICE:"ê³µì§ì¬í",EVENT:"íííì¬",PRESS:"ë³´ëìë£",BID:"ì ì°°ê³µê³ ",RECRUIT:"ì±ì©ê³µê³ "},q=function(){const{id:x}=k.useParams(),c=F(),[t,N]=d.useState(null),[g,p]=d.useState(!0),[h,u]=d.useState(null),b=async()=>{try{p(!0),u(null);const{data:s,error:r}=await f.from("board").select(` 2 *, 3 boardFile:boardFile(*) 4 `).eq("id",parseInt(x)).single();if(r)throw r;N(s)}catch(s){console.error("ê²ìê¸ ë¡ë ì¤ë¥:",s),u("ê²ìê¸ì ë¶ë¬ì¤ëë° ì¤í¨íìµëë¤.")}finally{p(!1)}};d.useEffect(()=>{b()},[x]);const v=s=>{const r=new Date(s),l=r.getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${l}.${a}.${n}`},w=s=>{if(s===0)return"0 Bytes";const r=1024,l=["Bytes","KB","MB","GB"],a=Math.floor(Math.log(s)/Math.log(r));return parseFloat((s/Math.pow(r,a)).toFixed(2))+" "+l[a]},y=async s=>{try{const{data:r}=f.storage.from("board-files").getPublicUrl(s.filePath),a=await(await fetch(r.publicUrl)).blob(),n=window.URL.createObjectURL(a),o=document.createElement("a");o.href=n,o.download=s.fileOriginalName,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(n)}catch(r){console.error("íì¼ ë¤ì´ë¡ë ì¤ë¥:",r),alert("íì¼ ë¤ì´ë¡ëì ì¤í¨íìµëë¤.")}};return g?e.jsx("section",{className:"scroll-py-16 py-16 md:scroll-py-32 md:py-32",children:e.jsx("div",{className:"mx-auto max-w-7xl px-4 md:px-6",children:e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(S,{className:"w-6 h-6 animate-spin"}),e.jsx("span",{className:"text-muted-foreground",children:"ê²ìê¸ì ë¶ë¬ì¤ë ì¤..."})]})})})}):h||!t?e.jsx("section",{className:"scroll-py-16 py-16 md:scroll-py-32 md:py-32",children:e.jsx("div",{className:"mx-auto max-w-7xl px-4 md:px-6",children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-red-500 mb-4",children:h||"ê²ìê¸ì ì°¾ì ì ììµëë¤."}),e.jsxs(i,{onClick:()=>c({to:"/news",search:{tab:void 0}}),variant:"outline",className:"rounded-[1px]",children:[e.jsx(j,{className:"w-4 h-4 mr-2"}),"목ë¡ì¼ë¡ ëìê°ê¸°"]})]})})}):e.jsx("section",{className:"scroll-py-16 py-16 md:scroll-py-32 md:py-32",children:e.jsx("div",{className:"mx-auto max-w-7xl px-4 md:px-6",children:e.jsxs("div",{className:"grid gap-y-12 lg:[grid-template-columns:auto_1fr] gap-x-16",children:[e.jsxs("div",{className:"text-center lg:text-left",children:[e.jsxs("h2",{className:"mb-4 text-3xl font-semibold md:text-4xl",children:["ìì ë° ì림 ",e.jsx("br",{className:"hidden lg:block"})]}),e.jsx("p",{className:"text-muted-foreground",children:"News & Notice"})]}),e.jsxs("div",{className:"sm:mx-auto sm:max-w-none lg:mx-0",children:[e.jsx("div",{className:"mb-8",children:e.jsxs(i,{onClick:()=>c({to:"/news",search:{tab:void 0}}),variant:"outline",className:"rounded-[1px] border-muted-foreground/20",children:[e.jsx(j,{className:"w-4 h-4 mr-2",strokeWidth:1.5}),"목ë¡ì¼ë¡ ëìê°ê¸°"]})}),e.jsxs("div",{className:"border border-muted-foreground/20 rounded-[1px] overflow-hidden",children:[e.jsxs("div",{className:"p-6 bg-muted/50 border-b border-muted-foreground/10",children:[e.jsx("div",{className:"flex items-center gap-2 mb-4",children:e.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-[1px] text-sm font-medium bg-primary/10 text-primary",children:U[t.boardType]||t.boardType})}),e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground leading-tight mb-4",children:t.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4",strokeWidth:1.5}),e.jsx("span",{children:t.authorName})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(L,{className:"w-4 h-4",strokeWidth:1.5}),e.jsx("span",{children:v(t.createdAt)})]}),t.boardFile&&t.boardFile.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{className:"w-4 h-4",strokeWidth:1.5}),e.jsxs("span",{children:["첨ë¶íì¼ ",t.boardFile.length,"ê°"]})]})]})]}),e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"prose prose-slate max-w-none prose-headings:text-foreground prose-p:text-foreground prose-p:leading-relaxed",children:e.jsx(C,{value:t.content?t.content:null,editable:!1,
4className:"border-none"})}),t.boardFile&&t.boardFile.length>0&&e.jsxs("div",{className:"mt-8 pt-6 border-t border-muted-foreground/10",children:[e.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center gap-2 text-foreground",children:[e.jsx(m,{className:"w-5 h-5",strokeWidth:1.5}),"첨ë¶íì¼"]}),e.jsx("div",{className:"space-y-2",children:t.boardFile.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/30 rounded-[1px] hover:bg-muted/50 transition-colors border border-muted-foreground/10",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx(m,{className:"w-4 h-4 text-muted-foreground flex-shrink-0",strokeWidth:1.5}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"font-medium text-foreground truncate",children:s.fileOriginalName}),e.jsx("p",{className:"text-sm text-muted-foreground",children:w(s.fileSize)})]})]}),e.jsxs(i,{onClick:()=>y(s),variant:"outline",size:"sm",className:"rounded-[1px] flex-shrink-0 border-muted-foreground/20",children:[e.jsx(R,{className:"w-4 h-4 mr-1",strokeWidth:1.5}),"ë¤ì´ë¡ë"]})]},s.id))})]})]})]}),e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsx(i,{onClick:()=>c({to:"/news",search:{tab:void 0}}),variant:"default",className:"rounded-[1px]",children:"목ë¡ì¼ë¡ ëìê°ê¸°"})})]})]})})})};export{q as component};
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.