PageSourceSearch

https://dashboard.neweb.ai/assets/GuestPostExchanges-tj_qAhei.js

js neweb.ai collected 2026-10-05 13:57:23 UTC 5,073 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-markdown-DIW4cXdl.js";import{C as v,a as y}from"./Card-Cekf8RV8.js";import{J as E,g as n,C as g,X as f,y as r}from"./index-C1i21spu.js";import{e as N,f as C,g as A,A as u}from"./useGuestPosts-DeTNMYCC.js";import{d as w,r as z}from"./vendor-react-DISSCkJ-.js";import{u as S}from"./vendor-i18n-B3RrgeHp.js";import{A as _}from"./arrow-left-W2MnAuNP.js";import"./vendor-redux-BUAhM-cm.js";import"./vendor-clerk-BTxT0tL0.js";import"./vendor-socket-DElUTK9t.js";function G(){const{t:s}=S(),p=w(),o={proposed:{label:s("guestExchanges.statusProposed"),color:"bg-blue-100 text-blue-700"},accepted:{label:s("guestExchanges.statusAccepted"),color:"bg-green-100 text-green-700"},content_pending:{label:s("guestExchanges.statusContentPending"),color:"bg-yellow-100 text-yellow-700"},published:{label:s("guestExchanges.statusPublished"),color:"bg-purple-100 text-purple-700"},completed:{label:s("guestExchanges.statusCompleted"),color:"bg-emerald-100 text-emerald-700"},rejected:{label:s("guestExchanges.statusRejected"),color:"bg-red-100 text-red-700"},canceled:{label:s("guestExchanges.statusCanceled"),color:"bg-gray-100 text-gray-600"}},[i,m]=z.useState(""),{data:c,isLoading:h}=N(i||void 0),l=C(),d=A(),x=async(t,a)=>{try{await l.mutateAsync({id:t,action:a}),r.success(s("guestExchanges.exchangeActionSuccess",{action:a}))}catch(j){r.error(j.response?.data?.message||s("guestExchanges.actionFailed",{action:a}))}},b=async t=>{try{await d.mutateAsync(t),r.success(s("guestExchanges.exchangeCompleted"))}catch{r.error(s("guestExchanges.completeFailed"))}};return e.jsxs("div",{className:"max-w-[1000px] mx-auto p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>p("/guest-posts"),className:"p-2 rounded-lg hover:bg-[var(--color-bg)] text-[var(--color-text-secondary)]",children:e.jsx(_,{size:20})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text-primary)]",children:s("guestExchanges.title")}),e.jsxs("p",{className:"text-sm text-[var(--color-text-secondary)]",children:[c?.length||0," ",s("guestExchanges.exchanges")]})]})]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("select",{value:i,onChange:t=>m(t.target.value),className:"text-sm border border-[var(--color-border)] rounded-lg px-3 py-1.5 bg-[var(--color-bg)] text-[var(--color-text-primary)]",children:[e.jsx("option",{value:"",children:s("guestExchanges.allStatuses")}),Object.entries(o).map(([t,{label:a}])=>e.jsx("option",{value:t,children:a},t))]})}),e.jsxs(v,{children:[e.jsx(y,{title:s("guestExchanges.exchanges")}),h?e.jsx("div",{className:"p-8 text-center",children:e.jsx(E,{className:"animate-spin mx-auto text-[var(--color-text-secondary)]",size:24})}):c?.length?e.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:c.map(t=>{const a=o[t.status]||{label:t.status,color:"bg-gray-100 text-gray-600"};return e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-medium text-[var(--color-text-primary)]",children:t.listingA?.websiteDomain||s("guestExchanges.siteA")}),e.jsx(u,{size:16,className:"text-[var(--color-text-secondary)]"}),e.jsx("span",{className:"font-medium text-[var(--color-text-primary)]",children:t.listingB?.websiteDomain||s("guestExchanges.siteB")})]}),e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${a.color}`,children:a.label})]}),e.jsxs("div",{className:"flex gap-2",children:[t.status==="proposed"&&e.jsxs(e.Fragment,{children:[e.jsxs(n,{variant:"primary",size:"sm",onClick:()=>x(t._id,"accept"),disabled:l.isPending,children:[e.jsx(g,{size:14,className:"mr-1"}),s("guestExchanges.accept")]}),e.jsxs(n,{variant:"default",size:"sm",onClick:()=>x(t._id,"reject"),disabled:l.isPending,children:[e.jsx(f,{size:14,className:"mr-1"}),s("guestExchanges.reject")]})]}),t.status==="published"&&e.jsxs(n,{variant:"primary",size:"sm",onClick:()=>b(t._id),disabled:d.isPending,children:[e.jsx(g,{size:14,className:"mr-1"}),s("guestExchanges.markComplete")]})]}),e.jsxs("div",{className:"text-xs text-[var(--color-text-secondary)]",children:[s("guestExchanges.created")," ",new Date(t.createdAt).toLocaleDateString(),t.postA?.publishedUrl&&e.jsxs("span",{children:[" ","• ",s("guestExchanges.postA")," ",e.jsx("a",{href:t.postA.publishedUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-primary)] underline",children:s("guestExchanges.published")})]}),t.postB?.publishedUrl&&e.jsxs("span",{children:[" ","• ",s("guestExchanges.postB")," ",e.jsx("a",{href:t.postB.publishedUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-primary)] underline",children:s("guestExchanges.published")})]})]})]},t._id)})}):e.jsxs("div",{className:"p-8 text-center text-[var(--color-text-secondary)]",children:[e.jsx(u,{size:40,className:"mx-auto mb-3 opacity-50"}),e.jsx("p",{children:s("guestExchanges.noExchanges")}
1)]})]})]})}export{G 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.