PageSourceSearch

https://sabhia.ai/assets/sales-dashboard-CQZFfkgM.js

js sabhia.ai collected 2026-10-05 12:33:53 UTC 23,265 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-motion-CPxq9Xvn.js";import{a2 as H,a1 as X,a3 as Q,ai as z,u as g,a6 as O,ar as Y,a7 as v,T as J,_ as T,l as Z,f as ee,C as te,X as se,a4 as ae,B as re,b as de,A as ie,an as h}from"./index-CFAvyuXu.js";import{B as k}from"./badge-B9GAfHbC.js";import{r as A}from"./vendor-i18n-CO3kK2bH.js";import{W as P}from"./wallet-DDm104dr.js";import{C as le}from"./chart-column-UGEAwQLz.js";import{C as ne}from"./circle-x-DhBMAj3Y.js";import{D as B}from"./download-B7FtiUYJ.js";import{G as L}from"./globe-D0MKCb1Y.js";import"./vendor-react-CQmBMThG.js";function a(d){return`R$ ${d.toFixed(2).replace(".",",")}`}function b(d){try{return new Date(d).toLocaleDateString("pt-BR")}catch{return d}}const oe={amazon:"bg-orange-500/20 text-orange-400 border-orange-500/30",amazon_kdp:"bg-orange-500/20 text-orange-400 border-orange-500/30",apple:"bg-gray-500/20 text-gray-300 border-gray-500/30",apple_books:"bg-gray-500/20 text-gray-300 border-gray-500/30",google:"bg-green-500/20 text-green-400 border-green-500/30",google_play:"bg-green-500/20 text-green-400 border-green-500/30",kobo:"bg-blue-500/20 text-blue-400 border-blue-500/30",barnes_noble:"bg-purple-500/20 text-purple-400 border-purple-500/30",streetlib:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30"};function y({platform:d}){const o=d.toLowerCase(),n=oe[o]||"bg-white/10 text-white/70 border-white/20";return e.jsx(k,{className:`${n} border text-xs`,"data-testid":`badge-platform-${o}`,children:d})}function $({status:d}){const o={completed:"bg-green-500/20 text-green-400 border-green-500/30",approved:"bg-green-500/20 text-green-400 border-green-500/30",pending:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",processing:"bg-blue-500/20 text-blue-400 border-blue-500/30",rejected:"bg-red-500/20 text-red-400 border-red-500/30",failed:"bg-red-500/20 text-red-400 border-red-500/30"},n={completed:"Concluído",approved:"Aprovado",pending:"Pendente",processing:"Processando",rejected:"Rejeitado",failed:"Falhou"},u=o[d]||o.pending;return e.jsx(k,{className:`${u} border text-xs`,"data-testid":`badge-status-${d}`,children:n[d]||d})}function Ne(){const{user:d}=H(),[,o]=X(),{toast:n}=Q(),u=z(),[S,F]=A.useState(""),[j,C]=A.useState("pix"),{data:r,isLoading:R}=g({queryKey:["/api/publishing/sales"],queryFn:()=>h("GET","/api/publishing/sales").then(t=>t.json())}),{data:c,isLoading:D}=g({queryKey:["/api/publishing/wallet"],queryFn:()=>h("GET","/api/publishing/wallet").then(t=>t.json())}),{data:p,isLoading:V}=g({queryKey:["/api/publishing/withdrawals"],queryFn:()=>h("GET","/api/publishing/withdrawals").then(t=>t.json())}),{data:f,isLoading:E}=g({queryKey:["/api/publishing/subscriptions"],queryFn:()=>h("GET","/api/publishing/subscriptions").then(t=>t.json())}),N=O({mutationFn:t=>h("POST","/api/publishing/withdrawals",t).then(s=>s.json()),onSuccess:()=>{n({title:"Solicitação enviada!",description:"Seu saque foi solicitado com sucesso."}),F(""),u.invalidateQueries({queryKey:["/api/publishing/wallet"]}
1),u.invalidateQueries({queryKey:["/api/publishing/withdrawals"]})},onError:t=>{n({title:"Erro ao solicitar saque",description:t.message||"Tente novamente.",variant:"destructive"})}}),_=(r||[]).reduce((t,s)=>t+(s.units||0),0),G=(r||[]).reduce((t,s)=>t+(s.grossAmount||0),0),w=c?.availableBalance||0,q=c?.pendingBalance||0,I=c?.totalEarned||0,K=c?.totalWithdrawn||0,m=c?.kycStatus||"pending",M=R||D||V,W=()=>{const t=parseFloat(S.replace(",","."));if(isNaN(t)||t<50){n({title:"Valor mínimo de R$ 50,00",variant:"destructive"});return}if(t>w){n({title:"Saldo insuficiente",variant:"destructive"});return}N.mutate({amount:t,method:j})};return e.jsx(Y,{children:e.jsxs("div",{className:"p-4 md:p-8 max-w-7xl mx-auto space-y-8",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-white","data-testid":"text-sales-title",children:"Painel de Vendas"}),e.jsx("p",{className:"text-lg text-muted-foreground mt-1","data-testid":"text-sales-subtitle",children:"Acompanhe suas vendas e gerencie seus ganhos"})]})}),M?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(v,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4","data-testid":"section-kpi-cards",children:[e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-6","data-testid":"card-kpi-total-sales",children:[e.jsx("div",{className:"flex items-center gap-3 mb-3",children:e.jsx("div",{className:"p-2 rounded-xl bg-primary/10",children:e.jsx(J,{className:"w-5 h-5 text-primary"})})}),e.jsx("p",{className:"text-2xl md:text-3xl font-bold text-white",children:_}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Total de Vendas"})]}),e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-6","data-testid":"card-kpi-gross-revenue",children:[e.jsx("div",{className:"flex items-center gap-3 mb-3",children:e.jsx("div",{className:"p-2 rounded-xl bg-green-500/10",children:e.jsx(T,{className:"w-5 h-5 text-green-400"})})}),e.jsx("p",{className:"text-2xl md:text-3xl font-bold text-white",children:a(G)}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Faturamento Bruto"})]}),e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-6","data-testid":"card-kpi-available-balance",children:[e.jsx("div",{className:"flex items-center gap-3 mb-3",children:e.jsx("div",{className:"p-2 rounded-xl bg-blue-500/10",children:e.jsx(P,{className:"w-5 h-5 text-blue-400"})})}),e.jsx("p",{className:"text-2xl md:text-3xl font-bold text-white",children:a(w)}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Saldo Disponível"})]}),e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-6","data-testid":"card-kpi-pending-balance",children:[e.jsx("div",{className:"flex items-center gap-3 mb-3",children:e.jsx("div",{className:"p-2 rounded-xl bg-yellow-500/10",children:e.jsx(Z,{className:"w-5 h-5 text-yellow-400"})})}),e.jsx("p",{className:"text-2xl md:text-3xl font-bold text-white",children:a(q)}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Saldo Pendente"})]})]}),r&&r.length>0&&e.jsxs("div",{"data-testid":"section-platform-breakdown",children:[e.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Vendas por Plataforma"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries((r||[]).reduce((t,s)=>{const i=s.platform||"Desconhecido";return t[i]||(t[i]={units:0,gross:0,net:0,sabhiaFee:0,platformFee:0,count:0}),t[i].units+=s.units||0,t[i].gross+=s.grossAmount||s.grossRevenue||0,t[i].net+=s.netAmount||s.netRevenue||0,t[i].sabhiaFee+=s.sabhiaFee||0,t[i].platformFee+=s.platformFee||0,t[i].count+=1,t},{})).sort((t,s)=>s[1].gross-t[1].gross).map(([t,s])=>e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-5","data-testid":`card-platform-${t}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx(y,{platform:t}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.count," registro(s)"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Unidades vendidas"}),e.jsx("span",{className:"text-sm font-semibold text-white",children:s.units})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Faturamento bruto"}),e.jsx("span",{className:"text-sm font-semibold text-white",children:a(s.gross)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Taxa da plataforma"}),e.jsxs("span",{className:"text-sm text-red-400",children:["-",a(s.platformFee)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Comissão SÁBHIA (5%)"}),e.jsxs("span",{className:"text-sm text-red-400",children:["-",a(s.sabhiaFee)]})]}),e.jsxs("div",{className:"border-t border-white/10 pt-2 flex justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Seu ganho líquido"}),e.jsx("span",{className:"text-sm font-bold text-emerald-400",children:a(s.net)})]})]})]},t))})]}),r&&r.length>0&&(()=>{const t=(r||[]).reduce((x,l)=>x+(l.grossAmount||l.grossRevenue||0),0),s=(r||[]).reduce((x,l)=>x+(l.platformFee||0),0),i=(r||[]).reduce((x,l)=>x+(l.sabhiaFee||0),0),U=(r||[]).reduce((x,l)=>x+(l.netAmount||l.netRevenue||0),0);return e.jsxs("div",{className:"bg-gradient-to-br from-primary/5 via-emerald-500/5 to-blue-500/5 border border-white/10 rounded-2xl p-6","data-testid":"card-commission-breakdown",children:[e.jsxs("h2",{className:"text-xl font-bold text-white mb-4 flex items-center gap-2",children:[e.jsx(T,{className:"w-5 h-5 text-emerald-400"}),"Detalhamento de Comissões"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-white",children:a(t)}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Faturamento Bruto"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["-",a(s)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Taxas das Plataformas"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-2xl font-bold text-amber-400",children:["-",a(i)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Comissão SÁBHIA (5%)"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-emerald-400",children:a(U)}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Seu Ganho Líquido"})]})]})]})})(),e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-white/10","data-testid":"section-sales-chart",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-blue-500/5 to-purple-500/5"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,rgba(45,212,191,0.08),transparent_60%)]"}),e.jsxs("div",{className:"relative flex flex-col items-center justify-center py-16 px-6 text-center",children:[e.jsx("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/10 mb-4",children:e.jsx(le,{className:"w-10 h-10 text-primary/60"})}),e.jsx("p",{className:"text-xl font-semibold text-white/80",children:"Gráfico de vendas disponível em breve"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2 max-w-md",children:"Visualize suas vendas ao longo do tempo com gráficos interativos"})]})]}),e.jsxs("div",{"data-testid":"section-sales-table",children:[e.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Histórico de Vendas"}),!r||r.length===0?e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-12 text-center",children:[e.jsx(ee,{className:"w-12 h-12 text-muted-foreground
1/40 mx-auto mb-4"}),e.jsx("p",{className:"text-lg text-muted-foreground","data-testid":"text-sales-empty",children:"Suas vendas aparecerão aqui quando seus livros começarem a vender"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block bg-white/5 border border-white/10 rounded-2xl overflow-hidden",children:e.jsxs("table",{className:"w-full","data-testid":"table-sales",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/10",children:[e.jsx("th",{className:"text-left text-sm font-medium text-muted-foreground px-4 py-3",children:"Data"}),e.jsx("th",{className:"text-left text-sm font-medium text-muted-foreground px-4 py-3",children:"Plataforma"}),e.jsx("th",{className:"text-left text-sm font-medium text-muted-foreground px-4 py-3",children:"Livro"}),e.jsx("th",{className:"text-right text-sm font-medium text-muted-foreground px-4 py-3",children:"Unidades"}),e.jsx("th",{className:"text-right text-sm font-medium text-muted-foreground px-4 py-3",children:"Valor Bruto"}),e.jsx("th",{className:"text-right text-sm font-medium text-muted-foreground px-4 py-3",children:"Taxa Plat."}),e.jsx("th",{className:"text-right text-sm font-medium text-muted-foreground px-4 py-3",children:"Taxa SÁBHIA (5%)"}),e.jsx("th",{className:"text-right text-sm font-medium text-muted-foreground px-4 py-3",children:"Valor Líquido"})]})}),e.jsx("tbody",{children:r.map((t,s)=>e.jsxs("tr",{className:"border-b border-white/5 hover:bg-white/5 transition-colors","data-testid":`row-sale-${s}`,children:[e.jsx("td",{className:"px-4 py-3 text-sm text-white",children:b(t.date||t.createdAt)}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(y,{platform:t.platform})}),e.jsx("td",{className:"px-4 py-3 text-sm text-white max-w-[200px] truncate",children:t.bookTitle||t.title}),e.jsx("td",{className:"px-4 py-3 text-sm text-white text-right",children:t.units}),e.jsx("td",{className:"px-4 py-3 text-sm text-white text-right",children:a(t.grossAmount||0)}),e.jsxs("td",{className:"px-4 py-3 text-sm text-red-400 text-right",children:["-",a(t.platformFee||0)]}),e.jsxs("td",{className:"px-4 py-3 text-sm text-red-400 text-right",children:["-",a(t.sabhiaFee||0)]}),e.jsx("td",{className:"px-4 py-3 text-sm text-green-400 text-right font-medium",children:a(t.netAmount||0)})]},t.id||s))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:r.map((t,s)=>e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-4 space-y-2","data-testid":`card-sale-mobile-${s}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{platform:t.platform}),e.jsx("span",{className:"text-xs text-muted-foreground",children:b(t.date||t.createdAt)})]}),e.jsx("p",{className:"text-sm font-medium text-white truncate",children:t.bookTitle||t.title}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[t.units," un."]}),e.jsx("span",{className:"text-green-400 font-medium",children:a(t.netAmount||0)})]})]},t.id||s))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6","data-testid":"section-wallet",children:[e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-6 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-xl bg-primary/10",children:e.jsx(P,{className:"w-6 h-6 text-primary"})}),e.jsx("h2",{className:"text-xl font-bold text-white",children:"Carteira"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-white/5",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Saldo Disponível"}),e.jsx("span",{className:"text-lg font-bold text-green-400","data-testid":"text-wallet-available",children:a(w)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-white/5",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Saldo Pendente"}),e.jsx("span",{className:"text-lg font-medium text-yellow-400","data-testid":"text-wallet-pending",children:a(q)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-white/5",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Total Recebido"}),e.jsx("span",{className:"text-lg font-medium text-white","data-testid":"text-wallet-earned",children:a(I)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-white/5",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Total Sacado"}),e.jsx("span",{className:"text-lg font-medium text-white","data-testid":"text-wallet-withdrawn",children:a(K)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Verificação KYC"}),e.jsx(k,{className:`border text-xs ${m==="verified"?"bg-green-500/20 text-green-400 border-green-500/30":m==="pending"?"bg-yellow-500/20 text-yellow-400 border-yellow-500/30":"bg-red-500/20 text-red-400 border-red-500/30"}`,"data-testid":"badge-kyc-status",children:m==="verified"?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-3 h-3 mr-1"})," Verificado"]}
1):m==="pending"?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-3 h-3 mr-1"})," Pendente"]}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-3 h-3 mr-1"})," Não verificado"]})})]})]})]}),e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-6 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-xl bg-green-500/10",children:e.jsx(B,{className:"w-6 h-6 text-green-400"})}),e.jsx("h2",{className:"text-xl font-bold text-white",children:"Solicitar Saque"})]}),m==="verified"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-muted-foreground mb-2 block",children:"Valor (mínimo R$ 50,00)"}),e.jsx(ae,{type:"text",inputMode:"decimal",placeholder:"0,00",value:S,onChange:t=>F(t.target.value),className:"bg-white/5 border-white/10 text-white text-lg h-12","data-testid":"input-withdraw-amount"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-muted-foreground mb-2 block",children:"Método"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("button",{onClick:()=>C("pix"),className:`px-4 py-3 rounded-xl border text-sm font-medium transition-all ${j==="pix"?"border-primary bg-primary/10 text-primary":"border-white/10 bg-white/5 text-muted-foreground hover:bg-white/10"}`,"data-testid":"button-method-pix",children:"PIX"}),e.jsx("button",{onClick:()=>C("bank_transfer"),className:`px-4 py-3 rounded-xl border text-sm font-medium transition-all ${j==="bank_transfer"?"border-primary bg-primary/10 text-primary":"border-white/10 bg-white/5 text-muted-foreground hover:bg-white/10"}`,"data-testid":"button-method-bank",children:"Transferência Bancária"})]})]}),e.jsx(re,{onClick:W,disabled:N.isPending,className:"w-full h-12 text-base bg-primary hover:bg-primary/90 rounded-xl","data-testid":"button-submit-withdraw",children:N.isPending?e.jsxs(e.Fragment,{children:[e.jsx(v,{className:"w-5 h-5 animate-spin mr-2"})," Processando..."]}):e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"w-5 h-5 mr-2"})," Solicitar Saque"]})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(de,{className:"w-12 h-12 text-yellow-400/60 mb-4"}),e.jsx("p",{className:"text-lg text-muted-foreground","data-testid":"text-kyc-required",children:"Complete sua verificação de identidade para solicitar saques"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-3","data-testid":"text-kyc-help",children:"Entre em contato com o suporte para verificar sua identidade e liberar saques."})]})]})]}),p&&p.length>0&&e.jsxs("div",{"data-testid":"section-withdrawal-history",children:[e.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Histórico de Saques"}),e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl overflow-hidden",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs("table",{className:"w-full","data-testid":"table-withdrawals",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/10",children:[e.jsx("th",{className:"text-left text-sm font-medium text-muted-foreground px-4 py-3",children:"Data"}),e.jsx("th",{className:"text-right text-sm font-medium text-muted-foreground px-4 py-3",children:"Valor"}),e.jsx("th",{className:"text-left text-sm font-medium text-muted-foreground px-4 py-3",children:"Método"}),e.jsx("th",{className:"text-left text-sm font-medium text-muted-foreground px-4 py-3",children:"Status"})]})}),e.jsx("tbody",{children:p.map((t,s)=>e.jsxs("tr",{className:"border-b border-white/5 hover:bg-white/5 transition-colors","data-testid":`row-withdrawal-${s}`,children:[e.jsx("td",{className:"px-4 py-3 text-sm text-white",children:b(t.createdAt||t.date)}),e.jsx("td",{className:"px-4 py-3 text-sm text-white text-right font-medium",children:a(t.amount||0)}),e.jsx("td",{className:"px-4 py-3 text-sm text-muted-foreground",children:t.method==="pix"?"PIX":"Transferência"}),e.jsx("td",{className:"px-4 py-3",children:e.jsx($,{status:t.status})})]},t.id||s))})]})}),e.jsx("div",{className:"md:hidden space-y-0 divide-y divide-white/5",children:p.map((t,s)=>e.jsxs("div",{className:"p-4 space-y-2","data-testid":`card-withdrawal-mobile-${s}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:b(t.createdAt||t.date)}),e.jsx($,{status:t.status})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:t.method==="pix"?"PIX":"Transferência"}),e.jsx("span",{className:"text-sm font-medium text-white",children:a(t.amount||0)})]})]},t.id||s))})]})]}),e.jsxs("div",{"data-testid":"section-published-books",children:[e.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Livros Publicados"}),E?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(v,{className:"w-6 h-6 animate-spin text-primary"})}):!f||f.length===0?e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-12 text-center",children:[e.jsx(L,{className:"w-12 h-12 text-muted-foreground
1/40 mx-auto mb-4"}),e.jsx("p",{className:"text-lg text-muted-foreground","data-testid":"text-books-empty",children:"Nenhum livro publicado ainda"})]}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:f.map((t,s)=>e.jsx("button",{onClick:()=>o(`/publicar/${t.bookId}`),className:"bg-white/5 border border-white/10 rounded-2xl p-4 text-left hover:bg-white/10 hover:border-white/20 transition-all group","data-testid":`card-published-book-${t.bookId||s}`,children:e.jsxs("div",{className:"flex gap-4",children:[t.coverUrl&&e.jsx("img",{src:t.coverUrl,alt:t.bookTitle||"Capa",className:"w-16 h-20 rounded-lg object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-base font-semibold text-white truncate group-hover:text-primary transition-colors",children:t.bookTitle||t.title||"Livro"}),e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(L,{className:"w-3 h-3 text-muted-foreground"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.platformCount||t.platforms?.length||0," plataformas"]})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.totalSales||0," vendas"]}),e.jsx("span",{className:"text-xs text-green-400 font-medium",children:a(t.totalRevenue||0)})]})]}),e.jsx(ie,{className:"w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors flex-shrink-0 mt-2"})]})},t.id||s))})]})]})]})})}export{Ne 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.