1 line
No EOL
2.2 KiB
JavaScript
1 line
No EOL
2.2 KiB
JavaScript
import{n as e}from"../chunks/loader-circle-CxzeMpQS.js";import{i as t,t as n}from"../chunks/PostCard-hYMtqskw.js";import{Fragment as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,createVNode as l,onMounted as u,openBlock as d,renderList as f,toDisplayString as p,unref as m,withCtx as h}from"vue";import{Link as g,router as _}from"@inertiajs/vue3";import{AppLayout as v,Button as y,http as b,toast as x}from"@inhaus/ui";var S=e({name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]}),C={class:`ih:mx-auto ih:grid ih:max-w-2xl ih:gap-4`},w={key:0,class:`ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm`},T={class:`ih:flex ih:items-center ih:gap-2 ih:font-medium`},E={class:`ih:mt-1 ih:list-disc ih:pl-6 ih:text-muted-foreground`},D={__name:`Post`,props:{group:{type:Object,required:!0},post:{type:Object,required:!0},comments:{type:Array,required:!0},reactions:{type:Array,required:!0},reports:{type:Array,default:()=>[]}},setup(e){let D=e;u(()=>{(location.hash&&document.querySelector(location.hash))?.scrollIntoView({block:`center`})});async function O(){await b.post(`/gruppen/beitraege/${D.post.id}/meldungen-erledigt`),x.success(`Meldungen erledigt`),_.reload()}return(u,b)=>(d(),i(m(v),{title:`Beitrag in ${e.group.name}`},{default:h(()=>[s(`div`,C,[l(m(g),{href:e.group.url,class:`ih:inline-flex ih:items-center ih:gap-1 ih:text-sm ih:font-medium ih:text-muted-foreground ih:hover:text-foreground`},{default:h(()=>[l(m(S),{class:`ih:size-4`}),c(` `+p(e.group.name),1)]),_:1},8,[`href`]),e.reports.length?(d(),o(`div`,w,[s(`p`,T,[l(m(t),{class:`ih:size-4 ih:text-destructive`}),c(` `+p(e.reports.length)+` `+p(e.reports.length===1?`Meldung`:`Meldungen`),1)]),s(`ul`,E,[(d(!0),o(r,null,f(e.reports,e=>(d(),o(`li`,{key:e.id},p(e.comment_id?`Kommentar: `:``)+p(e.reason),1))),128))]),l(m(y),{size:`sm`,variant:`outline`,class:`ih:mt-2`,onClick:O},{default:h(()=>[...b[1]||=[c(`In Ordnung – erledigt`,-1)]]),_:1})])):a(``,!0),l(n,{post:e.post,reactions:e.reactions,"full-comments":e.comments,onDeleted:b[0]||=t=>m(_).visit(e.group.url)},null,8,[`post`,`reactions`,`full-comments`])])]),_:1},8,[`title`]))}};export{D as default}; |