1import{j as e}from"./vendor-query-nkyHp8gL.js";import{L as d}from"./vendor-react-BNT0nzvx.js";import{D as x}from"./DashboardLayout-BQArLa03.js";import{c as p,d as h}from"./use-feed-CkPuES6R.js";import{i as u,B as a,Y as f,n as j,x as N}from"./index-BG1hbjB_.js";import{a as g}from"./use-role-guard-DUkhNAMS.js";import{N as l}from"./newspaper-CxHmHB1y.js";import{T as w}from"./trash-2-D8mh_ZKl.js";import{f as y}from"./formatDistanceToNow-CKXtw6Zh.js";import"./input-otp-BmijqesX.js";import"./shield-check-BjMYzFta.js";import"./shield-D2cqmhBs.js";import"./chevron-right-Bjkf53ML.js";import"./eye-CbHUV7pU.js";import"./mail-check-D7o3uZkb.js";import"./users-qXgsJLD-.js";import"./crown-CsNa2Jyx.js";import"./target-DCR3Hpgj.js";import"./list-CCtzf_Gh.js";import"./flag-BAn4BLiN.js";import"./vendor-ui-DPPUfW-O.js";import"./vendor-charts-B_MCcq71.js";import"./vendor-supabase-BRDBMtg7.js";import"./en-US-Dli8qwSn.js";import"./endOfMonth-DyeqHD7u.js";const v=()=>{const{data:r,isLoading:n}=p(),i=h(),{toast:o}=u(),c=async s=>{try{await i.mutateAsync(s),o({title:"Post deleted"})}catch(t){o({title:"Delete failed",description:t.message,variant:"destructive"})}};return e.jsx(x,{children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"w-6 h-6 text-primary"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"My Posts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your feed posts"})]})]}),e.jsx(a,{size:"sm",asChild:!0,children:e.jsxs(d,{to:"/dashboard/feed/new",children:[e.jsx(f,{className:"w-4 h-4 mr-1.5"})," New Post"]})})]}),n?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(j,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):r?.length?e.jsx("div",{className:"space-y-3",children:r.map(s=>e.jsx("div",{className:"border border-border rounded-lg p-4 bg-card",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[s.listing&&e.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["Posted as ",e.jsx("span",{className:"font-medium text-foreground",children:N(s.listing.title)})]}),e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap line-clamp-3",children:s.content}),s.images?.length>0&&e.jsx("div",{className:"flex gap-1.5 mt-2",children:s.images.map((t,m)=>e.jsx("img",{src:t,alt:`Post photo ${m+1}`,className:"w-12 h-12 rounded object-cover"},m))}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:y(new Date(s.created_at),{addSuffix:!0})})]}),e.jsx(a,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>c(s.id),disabled:i.isPending,children:e.jsx(w,{className:"w-4 h-4"})})]})},s.id))}):e.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[e.jsx(l,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-sm mb-2",children:"No posts yet"}),e.jsx(a,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(d,{to:"/dashboard/feed/new",children:"Create your first post"})})]})]})})},Q=g(v);export{Q 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.