1import{j as e}from"./vendor-query-omkHT0sw.js";import{i as _,r,L as h}from"./vendor-react-CFLemBDn.js";import{M as i,B as p,U as B,p as S,s as j}from"./index-DTvcvJCu.js";import{C as c,a as m}from"./card-BUV7tQXm.js";import{B as f}from"./badge-BCRuemk_.js";import{S as n}from"./skeleton-BlSa5zNF.js";import{c as C}from"./format-DoVIfqYk.js";import{B as u}from"./bell-BWN8KF6u.js";import{A as N}from"./arrow-left-xp_SmVlo.js";import{P as L}from"./pin-XS8XksTX.js";import{E as D}from"./eye-D3-vTRJT.js";import{D as E}from"./download-CIPES1Wb.js";import"./vendor-radix-DPSQSCYN.js";import"./vendor-supabase-CXidNrjy.js";const k={hanwoo:"ì¬ëê°íì°",garlic:"ë§ëìí",tomato:"í ë§í ",peach:"ë³µìì",plum:"ìë"};function O(){var d;const{id:t}=_(),[s,g]=r.useState(null),[y,l]=r.useState(!0),[w,b]=r.useState(!1);if(r.useEffect(()=>{if(!t)return;(async()=>{l(!0);const{data:a,error:v}=await j.from("notices").select("*, brands(name, code)").eq("id",t).eq("is_visible",!0).maybeSingle();if(v||!a){b(!0),l(!1);return}g(a),l(!1),await j.from("notices").update({view_count:(a.view_count||0)+1}).eq("id",t)})()},[t]),y)return e.jsxs(i,{children:[e.jsx("section",{className:"bg-secondary py-8 lg:py-12",children:e.jsx("div",{className:"container",children:e.jsx(n,{className:"h-10 w-48"})})}),e.jsx("section",{className:"py-8 lg:py-12",children:e.jsx("div",{className:"container max-w-4xl",children:e.jsx(c,{children:e.jsxs(m,{className:"py-8 space-y-4",children:[e.jsx(n,{className:"h-8 w-3/4"}),e.jsx(n,{className:"h-4 w-1/3"}),e.jsx(n,{className:"h-40 w-full"})]})})})})]});if(w||!s)return e.jsxs(i,{children:[e.jsx("section",{className:"bg-secondary py-8 lg:py-12",children:e.jsx("div",{className:"container",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(u,{className:"h-8 w-8 text-primary"}),e.jsx("h1",{className:"text-2xl lg:text-4xl font-bold text-foreground",children:"ê³µì§ì¬í"})]})})}),e.jsx("section",{className:"py-8 lg:py-12",children:e.jsxs("div",{className:"container max-w-4xl",children:[e.jsx(c,{children:e.jsx(m,{className:"py-12 text-center text-muted-foreground",children:"ì¡´ì¬íì§ ìë ê²ìê¸ì
ëë¤"})}),e.jsx("div",{className:"mt-6",children:e.jsx(p,{variant:"outline",asChild:!0,children:e.jsxs(h,{to:"/notices",children:[e.jsx(N,{className:"h-4 w-4 mr-2"}),"목ë¡ì¼ë¡"]})})})]})})]});const o=[s.attachment_url_1,s.attachment_url_2].filter(Boolean);return e.jsxs(i,{children:[e.jsx("section",{className:"bg-secondary py-8 lg:py-12",children:e.jsxs("div",{className:"container",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(u,{className:"h-8 w-8 text-primary"}),e.jsx("h1",{className:"text-2xl lg:text-4xl font-bold text-foreground",children:"ê³µì§ì¬í"})]}),e.jsx("p",{className:"text-muted-foreground",children:"ì¬ëê°ì ìë¡ì´ ììì íì¸íì¸ì"})]})}),e.jsx("section",{className:"py-8 lg:py-12",children:e.jsxs("div",{className:"container max-w-4xl",children:[e.jsx(c,{children:e.jsxs(m,{className:"py-6",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-3",children:[s.is_pinned&&e.jsx(L,{className:"h-4 w-4 text-primary"}),((d=s.brands)==null?void 0:d.code)&&e.jsx(f,{variant:"outline",className:"text-xs",children:k[s.brands.code]||s.brands.name}),s.is_pinned&&e.jsx(f,{className:"text-xs bg-primary",children:"ì¤ì"})]}),e.jsx("h2",{className:"text-xl lg:text-2xl font-bold text-foreground mb-4",children:s.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground border-b pb-4 mb-6",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"h-3.5 w-3.5"}),s.author_name||"ê´ë¦¬ì"]}),e.jsx("span",{children:C(s.created_at)}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"h-3.5 w-3.5"}),s.view_count||0]})]}),s.image_url&&e.jsx("div",{className:"mb-6",children:e.jsx("img",{src:s.image_url,alt:s.title,className:"max-w-full rounded-lg"})}),e.jsx("div",{className:"prose prose-sm max-w-none text-foreground whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:S.sanitize(s.content)}}),o.length>0&&e.jsxs("div",{className:"mt-6 pt-4 border-t",children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-2",children:"첨ë¶íì¼"}),e.jsx("div",{className:"space-y-2",children:o.map((x,a)=>e.jsxs("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-primary hover:underline",children:[e.jsx(E,{className:"h-4 w-4"}),"첨ë¶íì¼ ",a+1]},a))})]})]})}),e.jsx("div",{className:"mt-6",children:e.jsx(p,{variant:"outline",asChild:!0,children:e.jsxs(h,{to:"/notices",children:[e.jsx(N,{className:"h-4 w-4 mr-2"}),"목ë¡ì¼ë¡"]})})})]})})]})}export{O 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.