inhaus-plugin-kleinanzeigen/dist/pages/Mine.js
Friederich Loheide f05c44733f Kleinanzeigen-Plugin 1.0.0
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 17:06:02 +00:00

1 line
No EOL
5.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{t as e}from"../chunks/createLucideIcon-CYyWUN7r.js";import{t}from"../chunks/heart-CyCnSX5a.js";import{t as n}from"../chunks/image-off-BfSjK3tM.js";import{n as r,t as i}from"../chunks/trash-DzQOFBxr.js";import{t as a}from"../chunks/plus-CThDQH9c.js";import{Fragment as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createTextVNode as d,createVNode as f,normalizeClass as p,openBlock as m,renderList as h,toDisplayString as g,unref as _,watch as v,withCtx as y}from"vue";import{Link as b,router as x,usePage as S}from"@inertiajs/vue3";import{AppLayout as C,Button as w,EmptyState as T,PageHeader as E,formatDate as D,toast as O}from"@inhaus/ui";var k=e({name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]}),A=e({name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]}),j=e({name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]}),M=e({name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]}),N={key:0,class:`ih:grid ih:gap-3`},P=[`src`],F={key:1,class:`ih:grid ih:size-full ih:place-items-center ih:text-muted-foreground`},I={class:`ih:min-w-0 ih:flex-1`},L={class:`ih:flex ih:flex-wrap ih:items-center ih:gap-2`},R={key:0,class:`ih:rounded ih:bg-foreground ih:px-1.5 ih:py-0.5 ih:text-[11px] ih:font-medium ih:text-background`},z={class:`ih:mt-0.5 ih:flex ih:flex-wrap ih:items-center ih:gap-x-3 ih:text-xs ih:text-muted-foreground`},B={key:0,class:`ih:inline-flex ih:items-center ih:gap-1`},V={key:1,class:`ih:inline-flex ih:items-center ih:gap-1`},H={key:0,class:`ih:mt-1 ih:text-xs ih:text-destructive`},U={class:`ih:flex ih:shrink-0 ih:flex-wrap ih:gap-1`},W={key:1,class:`ih:rounded-lg ih:border ih:bg-card`},G={__name:`Mine`,props:{listings:{type:Array,required:!0}},setup(e){let G=S();v(()=>G.props.flash?.status,e=>e&&O.success(e),{immediate:!0});let K=(e,t)=>x.post(`/kleinanzeigen/${e.id}/${t}`,{},{preserveScroll:!0}),q=e=>window.confirm(`„${e.title}“ löschen?`)&&x.delete(`/kleinanzeigen/${e.id}`,{preserveScroll:!0}),J={pending:`ih:bg-accent ih:text-accent-foreground`,active:`ih:bg-brand-soft ih:text-brand-text`,rejected:`ih:bg-destructive/10 ih:text-destructive`,done:`ih:bg-muted ih:text-muted-foreground`,expired:`ih:bg-muted ih:text-muted-foreground`};return(v,x)=>(m(),s(_(C),{title:`Meine Anzeigen`},{default:y(()=>[f(_(E),{title:`Meine Anzeigen`,breadcrumbs:[{label:`Kleinanzeigen`,href:`/kleinanzeigen`}]},{actions:y(()=>[f(_(w),{"as-child":``},{default:y(()=>[f(_(b),{href:`/kleinanzeigen/neu`},{default:y(()=>[f(_(a)),x[0]||=d(` Anzeige aufgeben`,-1)]),_:1})]),_:1})]),_:1}),e.listings.length?(m(),l(`ul`,N,[(m(!0),l(o,null,h(e.listings,e=>(m(),l(`li`,{key:e.id,class:`ih:flex ih:flex-wrap ih:items-center ih:gap-4 ih:rounded-lg ih:border ih:bg-card ih:p-3 ih:shadow-xs ih:sm:flex-nowrap`},[f(_(b),{href:e.url,class:`ih:block ih:size-20 ih:shrink-0 ih:overflow-hidden ih:rounded-md ih:bg-muted`},{default:y(()=>[e.thumb_url?(m(),l(`img`,{key:0,src:e.thumb_url,alt:``,class:`ih:size-full ih:object-cover`},null,8,P)):(m(),l(`span`,F,[f(_(n),{class:`ih:size-6`})]))]),_:2},1032,[`href`]),u(`div`,I,[u(`div`,L,[f(_(b),{href:e.url,class:`ih:font-medium ih:hover:underline`},{default:y(()=>[d(g(e.title),1)]),_:2},1032,[`href`]),u(`span`,{class:p([`ih:rounded ih:px-1.5 ih:py-0.5 ih:text-[11px] ih:font-medium`,J[e.status]])},g(e.status_label),3),e.reserved?(m(),l(`span`,R,`Reserviert`)):c(``,!0)]),u(`p`,z,[u(`span`,null,g([e.type_label,e.price].filter(Boolean).join(` · `)),1),e.status===`active`&&e.expires_at?(m(),l(`span`,B,[f(_(k),{class:`ih:size-3`}),d(` bis `+g(_(D)(e.expires_at)),1)])):c(``,!0),e.favorites?(m(),l(`span`,V,[f(_(t),{class:`ih:size-3`}),d(` `+g(e.favorites)+`× gemerkt`,1)])):c(``,!0)]),e.status===`rejected`&&e.review_note?(m(),l(`p`,H,`Hinweis: `+g(e.review_note),1)):c(``,!0)]),u(`div`,U,[[`active`,`expired`].includes(e.status)?(m(),s(_(w),{key:0,variant:`outline`,size:`sm`,onClick:t=>K(e,`verlaengern`)},{default:y(()=>[f(_(j)),x[1]||=d(` Verlängern`,-1)]),_:1},8,[`onClick`])):c(``,!0),e.status===`active`?(m(),s(_(w),{key:1,variant:`ghost`,size:`sm`,onClick:t=>K(e,`reserviert`)},{default:y(()=>[f(_(M)),d(` `+g(e.reserved?`Nicht reserviert`:`Reserviert`),1)]),_:2},1032,[`onClick`])):c(``,!0),e.status===`active`?(m(),s(_(w),{key:2,variant:`ghost`,size:`sm`,onClick:t=>K(e,`erledigt`)},{default:y(()=>[f(_(A)),x[2]||=d(` Erledigt`,-1)]),_:1},8,[`onClick`])):c(``,!0),e.status===`done`?c(``,!0):(m(),s(_(w),{key:3,variant:`ghost`,size:`icon`,"aria-label":`${e.title} bearbeiten`,"as-child":``},{default:y(()=>[f(_(b),{href:e.edit_url},{default:y(()=>[f(_(r))]),_:1},8,[`href`])]),_:2},1032,[`aria-label`])),f(_(w),{variant:`ghost`,size:`icon`,class:`ih:text-muted-foreground ih:hover:text-destructive`,"aria-label":`${e.title} löschen`,onClick:t=>q(e)},{default:y(()=>[f(_(i))]),_:1},8,[`aria-label`,`onClick`])])]))),128))])):(m(),l(`div`,W,[f(_(T),{icon:_(M),title:`Sie haben noch keine Anzeigen`,text:`Etwas übrig oder auf der Suche? Geben Sie Ihre erste Anzeige auf.`},null,8,[`icon`])]))]),_:1}))}};export{G as default};