import{r as a,j as r,q as be,R as ve,$ as Se,Y as q,m as M}from"./app-BGey7YPf.js";import{U as we,A as ge}from"./app-layout-mnJEmZ7X.js";import{H as Ce}from"./header-D0w47C-P.js";import je from"./add-edit-post-BJSGcWXd.js";import{C as Pe,a as ye,b as Re,c as Ee,d as Te}from"./card-CgL3Iyx6.js";import{c as ee,u as _,P as D,a as re,B as j}from"./button-D5r5edT8.js";import{S as K}from"./separator-Di-l93J0.js";import{c as Ne,d as U,a as E,g as R,i as Ae}from"./index-BFyaOBDQ.js";import{u as _e}from"./index-Q2wK6uZI.js";import{e as Le}from"./select-BqSuhmAT.js";import{B as G}from"./badge-BVty0UEZ.js";import ke from"./add-edit-comment-DRmAa0n5.js";import{t as De,a as J,b as Q,P as ze,T as He,M as We}from"./modal-alert-delete-DTn_SFht.js";import{f as Me,w as Oe}from"./date-DEC3gYI7.js";import"./chevron-right-CE_1krjA.js";import"./input-CGSIKYsG.js";import"./icons-hx7HvmR4.js";import"./x-C4WIHhXm.js";import"./index-CwO5dfCw.js";import"./theme-provider-NKMbg-kV.js";import"./use-toast-DGElh_6W.js";import"./dialog-OAe1w9Cd.js";import"./label-BbSRpehS.js";import"./post-editor-BzjujAtF.js";import"./index-BuSoVzfP.js";import"./chevron-down-DOZGaFlM.js";import"./trash-Blc6Iqr5.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ie=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"m12 8-4 4 4 4",key:"15vm53"}]],Ue=ee("CircleArrowLeft",Ie);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ye=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Be=ee("Pencil",Ye);function Xe(e,o){return a.useReducer((t,l)=>o[t][l]??t,e)}var X="ScrollArea",[te,Lr]=Ne(X),[Ve,S]=te(X),oe=a.forwardRef((e,o)=>{const{__scopeScrollArea:t,type:l="hover",dir:n,scrollHideDelay:s=600,...i}=e,[c,d]=a.useState(null),[h,u]=a.useState(null),[f,m]=a.useState(null),[x,v]=a.useState(null),[P,L]=a.useState(null),[g,T]=a.useState(0),[p,y]=a.useState(0),[z,k]=a.useState(!1),[H,W]=a.useState(!1),b=_(o,N=>d(N)),w=_e(n);return r.jsx(Ve,{scope:t,type:l,dir:w,scrollHideDelay:s,scrollArea:c,viewport:h,onViewportChange:u,content:f,onContentChange:m,scrollbarX:x,onScrollbarXChange:v,scrollbarXEnabled:z,onScrollbarXEnabledChange:k,scrollbarY:P,onScrollbarYChange:L,scrollbarYEnabled:H,onScrollbarYEnabledChange:W,onCornerWidthChange:T,onCornerHeightChange:y,children:r.jsx(D.div,{dir:w,...i,ref:b,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":p+"px",...e.style}})})});oe.displayName=X;var ne="ScrollAreaViewport",le=a.forwardRef((e,o)=>{const{__scopeScrollArea:t,children:l,nonce:n,...s}=e,i=S(ne,t),c=a.useRef(null),d=_(o,c,i.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),r.jsx(D.div,{"data-radix-scroll-area-viewport":"",...s,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:r.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});le.displayName=ne;var C="ScrollAreaScrollbar",V=a.forwardRef((e,o)=>{const{forceMount:t,...l}=e,n=S(C,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=n,c=e.orientation==="horizontal";return a.useEffect(()=>(c?s(!0):i(!0),()=>{c?s(!1):i(!1)}),[c,s,i]),n.type==="hover"?r.jsx(Fe,{...l,ref:o,forceMount:t}):n.type==="scroll"?r.jsx($e,{...l,ref:o,forceMount:t}):n.type==="auto"?r.jsx(se,{...l,ref:o,forceMount:t}):n.type==="always"?r.jsx(F,{...l,ref:o}):null});V.displayName=C;var Fe=a.forwardRef((e,o)=>{const{forceMount:t,...l}=e,n=S(C,e.__scopeScrollArea),[s,i]=a.useState(!1);return a.useEffect(()=>{const c=n.scrollArea;let d=0;if(c){const h=()=>{window.clearTimeout(d),i(!0)},u=()=>{d=window.setTimeout(()=>i(!1),n.scrollHideDelay)};return c.addEventListener("pointerenter",h),c.addEventListener("pointerleave",u),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",h),c.removeEventListener("pointerleave",u)}}},[n.scrollArea,n.scrollHideDelay]),r.jsx(U,{present:t||s,children:r.jsx(se,{"data-state":s?"visible":"hidden",...l,ref:o})})}),$e=a.forwardRef((e,o)=>{const{forceMount:t,...l}=e,n=S(C,e.__scopeScrollArea),s=e.orientation==="horizontal",i=B(()=>d("SCROLL_END"),100),[c,d]=Xe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>d("HIDE"),n.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,n.scrollHideDelay,d]),a.useEffect(()=>{const h=n.viewport,u=s?"scrollLeft":"scrollTop";if(h){let f=h[u];const m=()=>{const x=h[u];f!==x&&(d("SCROLL"),i()),f=x};return h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[n.viewport,s,d,i]),r.jsx(U,{present:t||c!=="hidden",children:r.jsx(F,{"data-state":c==="hidden"?"hidden":"visible",...l,ref:o,onPointerEnter:E(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:E(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),se=a.forwardRef((e,o)=>{const t=S(C,e.__scopeScrollArea),{forceMount:l,...n}=e,[s,i]=a.useState(!1),c=e.orientation==="horizontal",d=B(()=>{if(t.viewport){const h=t.viewport.offsetWidth<t.viewport.scrollWidth,u=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?h:u)}},10);return A(t.viewport,d),A(t.content,d),r.jsx(U,{present:l||s,children:r.jsx(F,{"data-state":s?"visible":"hidden",...n,ref:o})})}),F=a.forwardRef((e,o)=>{const{orientation:t="vertical",...l}=e,n=S(C,e.__scopeScrollArea),s=a.useRef(null),i=a.useRef(0),[c,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=ue(c.viewport,c.content),u={...l,sizes:c,onSizesChange:d,hasThumb:h>0&&h<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:m=>i.current=m};function f(m,x){return Ze(m,i.current,c,x)}return t==="horizontal"?r.jsx(qe,{...u,ref:o,onThumbPositionChange:()=>{if(n.viewport&&s.current){const m=n.viewport.scrollLeft,x=Z(m,c,n.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:m=>{n.viewport&&(n.viewport.scrollLeft=m)},onDragScroll:m=>{n.viewport&&(n.viewport.scrollLeft=f(m,n.dir))}}):t==="vertical"?r.jsx(Ke,{...u,ref:o,onThumbPositionChange:()=>{if(n.viewport&&s.current){const m=n.viewport.scrollTop,x=Z(m,c);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:m=>{n.viewport&&(n.viewport.scrollTop=m)},onDragScroll:m=>{n.viewport&&(n.viewport.scrollTop=f(m))}}):null}),qe=a.forwardRef((e,o)=>{const{sizes:t,onSizesChange:l,...n}=e,s=S(C,e.__scopeScrollArea),[i,c]=a.useState(),d=a.useRef(null),h=_(o,d,s.onScrollbarXChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),r.jsx(ie,{"data-orientation":"horizontal",...n,ref:h,sizes:t,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Y(t)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(s.viewport){const m=s.viewport.scrollLeft+u.deltaX;e.onWheelScroll(m),me(m,f)&&u.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&l({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:I(i.paddingLeft),paddingEnd:I(i.paddingRight)}})}})}),Ke=a.forwardRef((e,o)=>{const{sizes:t,onSizesChange:l,...n}=e,s=S(C,e.__scopeScrollArea),[i,c]=a.useState(),d=a.useRef(null),h=_(o,d,s.onScrollbarYChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),r.jsx(ie,{"data-orientation":"vertical",...n,ref:h,sizes:t,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Y(t)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(s.viewport){const m=s.viewport.scrollTop+u.deltaY;e.onWheelScroll(m),me(m,f)&&u.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&l({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:I(i.paddingTop),paddingEnd:I(i.paddingBottom)}})}})}),[Ge,ae]=te(C),ie=a.forwardRef((e,o)=>{const{__scopeScrollArea:t,sizes:l,hasThumb:n,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:h,onWheelScroll:u,onResize:f,...m}=e,x=S(C,t),[v,P]=a.useState(null),L=_(o,b=>P(b)),g=a.useRef(null),T=a.useRef(""),p=x.viewport,y=l.content-l.viewport,z=R(u),k=R(d),H=B(f,10);function W(b){if(g.current){const w=b.clientX-g.current.left,N=b.clientY-g.current.top;h({x:w,y:N})}}return a.useEffect(()=>{const b=w=>{const N=w.target;(v==null?void 0:v.contains(N))&&z(w,y)};return document.addEventListener("wheel",b,{passive:!1}),()=>document.removeEventListener("wheel",b,{passive:!1})},[p,v,y,z]),a.useEffect(k,[l,k]),A(v,H),A(x.content,H),r.jsx(Ge,{scope:t,scrollbar:v,hasThumb:n,onThumbChange:R(s),onThumbPointerUp:R(i),onThumbPositionChange:k,onThumbPointerDown:R(c),children:r.jsx(D.div,{...m,ref:L,style:{position:"absolute",...m.style},onPointerDown:E(e.onPointerDown,b=>{b.button===0&&(b.target.setPointerCapture(b.pointerId),g.current=v.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),W(b))}),onPointerMove:E(e.onPointerMove,W),onPointerUp:E(e.onPointerUp,b=>{const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),document.body.style.webkitUserSelect=T.current,x.viewport&&(x.viewport.style.scrollBehavior=""),g.current=null})})})}),O="ScrollAreaThumb",ce=a.forwardRef((e,o)=>{const{forceMount:t,...l}=e,n=ae(O,e.__scopeScrollArea);return r.jsx(U,{present:t||n.hasThumb,children:r.jsx(Je,{ref:o,...l})})}),Je=a.forwardRef((e,o)=>{const{__scopeScrollArea:t,style:l,...n}=e,s=S(O,t),i=ae(O,t),{onThumbPositionChange:c}=i,d=_(o,f=>i.onThumbChange(f)),h=a.useRef(void 0),u=B(()=>{h.current&&(h.current(),h.current=void 0)},100);return a.useEffect(()=>{const f=s.viewport;if(f){const m=()=>{if(u(),!h.current){const x=er(f,c);h.current=x,c()}};return c(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[s.viewport,u,c]),r.jsx(D.div,{"data-state":i.hasThumb?"visible":"hidden",...n,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:E(e.onPointerDownCapture,f=>{const x=f.target.getBoundingClientRect(),v=f.clientX-x.left,P=f.clientY-x.top;i.onThumbPointerDown({x:v,y:P})}),onPointerUp:E(e.onPointerUp,i.onThumbPointerUp)})});ce.displayName=O;var $="ScrollAreaCorner",de=a.forwardRef((e,o)=>{const t=S($,e.__scopeScrollArea),l=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&l?r.jsx(Qe,{...e,ref:o}):null});de.displayName=$;var Qe=a.forwardRef((e,o)=>{const{__scopeScrollArea:t,...l}=e,n=S($,t),[s,i]=a.useState(0),[c,d]=a.useState(0),h=!!(s&&c);return A(n.scrollbarX,()=>{var f;const u=((f=n.scrollbarX)==null?void 0:f.offsetHeight)||0;n.onCornerHeightChange(u),d(u)}),A(n.scrollbarY,()=>{var f;const u=((f=n.scrollbarY)==null?void 0:f.offsetWidth)||0;n.onCornerWidthChange(u),i(u)}),h?r.jsx(D.div,{...l,ref:o,style:{width:s,height:c,position:"absolute",right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function I(e){return e?parseInt(e,10):0}function ue(e,o){const t=e/o;return isNaN(t)?0:t}function Y(e){const o=ue(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=(e.scrollbar.size-t)*o;return Math.max(l,18)}function Ze(e,o,t,l="ltr"){const n=Y(t),s=n/2,i=o||s,c=n-i,d=t.scrollbar.paddingStart+i,h=t.scrollbar.size-t.scrollbar.paddingEnd-c,u=t.content-t.viewport,f=l==="ltr"?[0,u]:[u*-1,0];return he([d,h],f)(e)}function Z(e,o,t="ltr"){const l=Y(o),n=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,s=o.scrollbar.size-n,i=o.content-o.viewport,c=s-l,d=t==="ltr"?[0,i]:[i*-1,0],h=Le(e,d);return he([0,i],[0,c])(h)}function he(e,o){return t=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const l=(o[1]-o[0])/(e[1]-e[0]);return o[0]+l*(t-e[0])}}function me(e,o){return e>0&&e<o}var er=(e,o=()=>{})=>{let t={left:e.scrollLeft,top:e.scrollTop},l=0;return function n(){const s={left:e.scrollLeft,top:e.scrollTop},i=t.left!==s.left,c=t.top!==s.top;(i||c)&&o(),t=s,l=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(l)};function B(e,o){const t=R(e),l=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(l.current),[]),a.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(t,o)},[t,o])}function A(e,o){const t=R(o);Ae(()=>{let l=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(t)});return n.observe(e),()=>{window.cancelAnimationFrame(l),n.unobserve(e)}}},[e,t])}var fe=oe,rr=le,tr=de;const pe=a.forwardRef(({className:e,children:o,...t},l)=>r.jsxs(fe,{ref:l,className:re("relative overflow-hidden",e),...t,children:[r.jsx(rr,{className:"h-full w-full rounded-[inherit]",children:o}),r.jsx(xe,{}),r.jsx(tr,{})]}));pe.displayName=fe.displayName;const xe=a.forwardRef(({className:e,orientation:o="vertical",...t},l)=>r.jsx(V,{ref:l,orientation:o,className:re("flex touch-none select-none transition-colors",o==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",o==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...t,children:r.jsx(ce,{className:"relative flex-1 rounded-full bg-border"})}));xe.displayName=V.displayName;function or(){const{post:e,comments:o,topics:t}=be().props,[l,n]=a.useState({open:!1,post:e,isUpdate:!1}),s=p=>{n({open:!0,post:p,isUpdate:!0})},[i,c]=a.useState(!1),[d,h]=a.useState(null),u=()=>{h(null),c(!0)},f=p=>{h(p),c(!0)},m=p=>{M.post(route("forum.likes.store",["comment",p.id]),{},{preserveScroll:!0})},x=p=>{M.delete(route("forum.likes.destroy",["comment",p.id]),{preserveScroll:!0})},v=p=>{M.post(route("forum.likes.store",["post",p.id]),{},{preserveScroll:!0})},P=p=>{M.delete(route("forum.likes.destroy",["post",p.id]),{preserveScroll:!0})},[L,g]=ve.useState(!1),T=p=>{h(p),g(!0)};return r.jsxs(r.Fragment,{children:[r.jsx(Se,{title:e.title}),r.jsx(Ce,{title:e.title,subtitle:`Topik: ${e.topic.name} — Oleh ${e.user.name}`,children:e.can.update&&r.jsxs(j,{size:"sm",variant:"secondary",onClick:()=>s(e),children:[r.jsx(Be,{className:"w-4 h-4 mr-1"}),"Edit Post"]})}),r.jsxs("div",{className:"p-4 max-w-3xl mx-auto",children:[r.jsxs(Pe,{className:"shadow-xl border border-muted rounded-2xl",children:[r.jsx(ye,{children:r.jsxs("div",{className:"flex justify-between items-start gap-4 flex-wrap",children:[r.jsx("div",{children:r.jsx(j,{asChild:!0,variant:"outline",size:"icon",children:r.jsx(q,{href:route("forum.posts.index",{topic:e.topic.slug}),className:"flex items-center gap-1",children:r.jsx(Ue,{className:"w-4 h-4"})})})}),r.jsxs("div",{className:"flex flex-col items-end text-right space-y-1 max-w-[calc(100%-3rem)] md:max-w-[75%]",children:[r.jsx(Re,{className:"text-2xl font-semibold truncate",title:e.title,children:De(e.title,8)}),r.jsx(Ee,{className:"text-sm text-muted-foreground",children:r.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[r.jsxs(G,{variant:"secondary",children:["Topik: ",e.topic.name]}),r.jsxs(G,{variant:"outline",children:["Oleh: ",e.user.name]})]})})]})]})}),r.jsx(K,{}),r.jsxs(Te,{children:[r.jsx("div",{className:"prose max-w-none prose-slate dark:prose-invert mt-4",dangerouslySetInnerHTML:{__html:e.html}}),r.jsxs("div",{className:"flex flex-wrap gap-3 justify-between mt-4",children:[r.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Dibuat pada: ",Me(e.created_at)]}),r.jsxs(j,{className:`rounded-full h-7 px-2 text-xs ${e.has_liked?"text-primary":"text-muted-foreground"}`,size:"sm",variant:"ghost",onClick:()=>e.has_liked?P(e):v(e),children:[e.has_liked?r.jsx(J,{className:"mr-1 w-3 h-3"}):r.jsx(Q,{className:"mr-1 w-3 h-3"}),e.likes_count]})]}),r.jsx(K,{className:"my-6"}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"Komentar:"}),r.jsx(j,{size:"sm",onClick:u,children:"Tambah Komentar"})]}),r.jsx(pe,{className:"max-h-[28rem] overflow-y-auto pr-2 border border-dashed",children:r.jsx("ul",{className:"space-y-3",children:o.data.length>0?o.data.map(p=>{var y;return r.jsxs("li",{className:"relative bg-muted border border-border p-4 rounded-2xl shadow-sm transition hover:shadow-md",children:[r.jsx("div",{className:"absolute top-2 right-2",children:r.jsxs(j,{className:"rounded-full h-7 px-3 text-xs",size:"sm",variant:"ghost",onClick:()=>p.has_liked?x(p):m(p),children:[p.has_liked?r.jsx(J,{className:"mr-1 w-3 h-3 text-primary"}):r.jsx(Q,{className:"mr-1 w-3 h-3 text-muted-foreground"}),p.likes_count]})}),r.jsxs("div",{className:"pr-24",children:[r.jsx("div",{className:"font-semibold text-sm",children:(y=p.user)==null?void 0:y.name}),r.jsx("div",{className:"text-sm mt-1 prose dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:p.html}}),r.jsx("div",{className:"text-xs text-muted-foreground mt-2 italic",children:Oe(p.created_at)})]}),r.jsxs("div",{className:"absolute bottom-2 right-2 flex items-center gap-1",children:[p.can.update&&r.jsx(j,{size:"icon",variant:"ghost",className:"w-6 h-6",onClick:()=>f(p),children:r.jsx(ze,{className:"w-4 h-4"})}),p.can.delete&&r.jsx(j,{size:"icon",variant:"ghost",className:"w-6 h-6 text-destructive hover:bg-red-100 dark:hover:bg-red-900",onClick:()=>T(p),children:r.jsx(He,{className:"w-4 h-4"})})]})]},p.id)}):r.jsx("p",{className:"text-muted-foreground text-sm",children:"Belum ada komentar."})})})]})]})]}),r.jsx("div",{className:"mt-6 flex justify-center",children:r.jsx(j,{asChild:!0,variant:"link",className:"text-sm",children:r.jsxs(q,{href:route("forum.posts.index",{topic:e.topic.slug}),className:"inline-flex items-center gap-1",children:[r.jsx(we,{className:"w-4 h-4"}),"Kembali ke Topik: ",e.topic.name]})})})]}),r.jsx(je,{open:l.open,post:l.post,isUpdate:l.isUpdate,onClose:()=>n({...l,open:!1}),topics:t}),r.jsx(ke,{open:i,onClose:()=>c(!1),comment:d,isUpdate:!!d,post:e}),d&&r.jsx(We,{open:L,onOpenChange:g,url:route("forum.comments.destroy",d.id)})]})}or.layout=e=>r.jsx(ge,{children:e});export{or as default};
