PageSourceSearch

https://divulgaexgyn.lovable.app/assets/Servicos-CT0FpS-C.js

js divulgaexgyn.lovable.app collected 2026-10-03 02:37:53 UTC 3,826 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-motion-Cs4t2Nru.js";import{r as l}from"./vendor-react-DZkXyRe8.js";import{L as h,B as b,s as i,u as j}from"./index-CxsVn8Pj.js";import{C as c,c as d}from"./card-BAlsJGvH.js";import{B as v}from"./badge-Dr-DUC4K.js";import{S as m}from"./shopping-bag-DFrajv9L.js";import{C as u}from"./circle-check-DdxmGLKr.js";import{E as N}from"./external-link-DocrzQYD.js";import{C as _}from"./clock-DK4pkgT1.js";import{P as y,T as w}from"./truck-Bjwb_tyK.js";import{C}from"./circle-x-D_eXZj55.js";import"./vendor-router-BgrPCJOB.js";import"./vendor-supabase-C7dOFRwv.js";const p={pendente:{label:"Pendente",color:"bg-yellow-500/10 text-yellow-700 border-yellow-500/20",icon:_},aprovado:{label:"Aprovado",color:"bg-blue-500/10 text-blue-700 border-blue-500/20",icon:u},em_producao:{label:"Em Produção",color:"bg-purple-500/10 text-purple-700 border-purple-500/20",icon:y},entregue:{label:"Entregue",color:"bg-green-500/10 text-green-700 border-green-500/20",icon:w},cancelado:{label:"Cancelado",color:"bg-red-500/10 text-red-700 border-red-500/20",icon:C}};function M(){const[n,x]=l.useState([]),[f,o]=l.useState(!0);return l.useEffect(()=>{(async()=>{const{data:{user:r}}=await i.auth.getUser();if(!r)return o(!1);const{data:a}=await i.rpc("get_client_id_for_user",{_user_id:r.id});if(!a)return o(!1);const{data:t,error:g}=await i.from("orders").select("id, servico, valor_total, status, metodo_pagamento, created_at, delivery_message, delivery_file").eq("client_id",a).order("created_at",{ascending:!1});g?j.error("Erro ao carregar serviços"):x(t||[]),o(!1)})()},[]),f?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(h,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h2",{className:"font-display text-2xl font-bold flex items-center gap-2",children:[e.jsx(m,{className:"h-6 w-6"}),"Meus Serviços"]}),n.length===0?e.jsx(c,{children:e.jsxs(d,{className:"py-12 text-center text-muted-foreground",children:[e.jsx(m,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"Nenhum serviço contratado ainda."})]})}):e.jsx("div",{className:"space-y-4",children:n.map(s=>{const r=p[s.status]||p.pendente,a=r.icon,t=s.status==="entregue";return e.jsx(c,{className:t?"border-green-500/20":"",children:e.jsxs(d,{className:"py-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-graphite",children:s.servico}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[new Date(s.created_at).toLocaleDateString("pt-BR")," • R$",s.valor_total.toFixed(2)]})]}),e.jsxs(v,{variant:"outline",className:r.color,children:[e.jsx(a,{className:"w-3 h-3 mr-1"}),r.label]})]}),t&&e.jsxs("div",{className:"bg-green-500/5 border border-green-500/20 rounded-lg p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-700",children:[e.jsx(u,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-semibold",children:"Entrega Realizada"})]}),e.jsx("p",{className:"text-sm text-graphite-light",children:s.delivery_message||"Seu serviço foi entregue com sucesso. Obrigado por confiar em nosso trabalho."}),s.delivery_file&&e.jsx(b,{size:"sm",variant:"outline",asChild:!0,className:"mt-2",children:e.jsxs("a",{href:s.delivery_file,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(N,{className:"w-3.5 h-3.5 mr-1.5"}),"Visualizar Entrega"]})})]}),s.status==="em_producao"&&e.jsx("div",{className:"bg-purple-500/5 border border-purple-500/20 rounded-lg p-3 mt-2",children:e.jsx("p",{className:"text-xs text-purple-700",children:"🔨 Seu serviço está sendo produzido. Você será notificado quando estiver pronto."})})]})},s.id)})})]})}export{M 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.