PageSourceSearch

https://otentecnologia.com.br/assets/Extensions-ClJiiMC-.js

js otentecnologia.com.br collected 2026-09-30 05:28:46 UTC 7,508 bytes, 1 lines download raw bytes

1import{r as e,j as s}from"./framer-DNXtdBgj.js";import{a,u as r,bb as i,v as t,B as n,I as o,e as l}from"./index-XTUkK5WH.js";import{u as c}from"./useMutation-DcVFqQKd.js";import{A as d}from"./AdminLayout-DLcnHFvP.js";import{T as x,a as m,b as h,c as j,d as u,e as p}from"./table-wmXj8cEG.js";import{S as g,a as f,b as v,c as w,d as N}from"./select-DQMgvcBO.js";import{B as b}from"./badge-5FdbKFYY.js";import{A as y,a as k,b as C,c as E,d as S,e as P,f as _,g as q,h as z}from"./alert-dialog-CdOOWjfz.js";import{S as A}from"./users-round-C_OE1rsU.js";import{P as L}from"./plus-BWMdkkfo.js";import{S as F}from"./search-B3aOT83d.js";import{E as T}from"./eye-DGqLm-TM.js";import{F as B}from"./file-text-IPr1Bv1X.js";import{S as K}from"./shield-check-BW2RZQX9.js";import{B as M}from"./book-open-BVLVX2es.js";import{P as R}from"./pencil-CX2IfFbO.js";import{T as $}from"./trash-2-CSXn37pz.js";import"./supabase-CVkO6afG.js";import"./rocket-Ckmnaf0E.js";import"./wrench-k69Xhg9M.js";import"./factory-g-lDNgT_.js";import"./target-CQCdL--z.js";import"./package-BE07Fgma.js";import"./puzzle-ms8g5hLX.js";import"./building-2-Cf048s_3.js";import"./users-BomTj5bm.js";import"./chart-column-x2tYRpNA.js";import"./index-jVOyRz7F.js";import"./chevron-up-Z5mg4Tbw.js";function G(){const G=a(),[V,I]=e.useState(""),[Q,D]=e.useState("all"),{toast:J}=r(),U=i(),{data:Z,isLoading:H}=t({queryKey:["extensions"],queryFn:async()=>{const{data:e,error:s}=await l.from("extensions").select("*").order("sort_order");if(s)throw s;return e}}),{data:O}=t({queryKey:["extensions-with-terms"],queryFn:async()=>{const{data:e,error:s}=await l.from("extension_terms").select("extension_id, status");if(s)throw s;return e||[]}}),W=new Map((O||[]).map(e=>[e.extension_id,e.status])),{data:X}=t({queryKey:["extensions-with-privacy"],queryFn:async()=>{const{data:e,error:s}=await l.from("extension_privacy").select("extension_id, status");if(s)throw s;return e||[]}}),Y=new Map((X||[]).map(e=>[e.extension_id,e.status])),ee=c({mutationFn:async e=>{const{error:s}=await l.from("extensions").delete().eq("id",e);if(s)throw s},onSuccess:()=>{U.invalidateQueries({queryKey:["extensions"]}),J({title:"Extensão excluída com sucesso!"})},onError:()=>{J({title:"Erro ao excluir extensão",variant:"destructive"})}}),se=Z?.filter(e=>(e.name.toLowerCase().includes(V.toLowerCase())||e.slug.toLowerCase().includes(V.toLowerCase()))&&("all"===Q||e.status===Q)),ae=e=>{switch(e){case"published":return s.jsx(b,{className:"bg-green-500/20 text-green-400 border-green-500/30",children:"Publicado"});case"draft":return s.jsx(b,{variant:"secondary",children:"Rascunho"});default:return s.jsx(b,{variant:"outline",children:e})}};return s.jsx(d,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Extensões"}),s.jsx("p",{className:"text-muted-foreground",children:"Gerencie as extensões do Zoho Marketplace"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(n,{variant:"outline",onClick:()=>G("/admin/extensions/help-settings"),children:[s.jsx(A,{className:"h-4 w-4 mr-2"}),"Globais da Ajuda"]}),s.jsxs(n,{className:"gradient-primary",onClick:()=>G("/admin/extensions/new"),children:[s.jsx(L,{className:"h-4 w-4 mr-2"}),"Nova Extensão"]})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(F,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(o,{placeholder:"Buscar extensões...",value:V,onChange:e=>I(e.target.value),className:"pl-10"})]}),s.jsxs(g,{value:Q,onValueChange:D,children:[s.jsx(f,{className:"w-[180px]",children:s.jsx(v,{placeholder:"Status"})}),s.jsxs(w,{children:[s.jsx(N,{value:"all",children:"Todos"}),s.jsx(N,{value:"draft",children:"Rascunho"}),s.jsx(N,{value:"published",children:"Publicado"})]})]})]}),s.jsx("div",{className:"rounded-xl border bg-card",children:s.jsxs(x,{children:[s.jsx(m,{children:s.jsxs(h,{children:[s.jsx(j,{children:"Extensão"}),s.jsx(j,{children:"Plataforma"}
1),s.jsx(j,{children:"Preço"}),s.jsx(j,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(T,{className:"h-4 w-4"}),"Views"]})}),s.jsx(j,{children:"Status"}),s.jsx(j,{children:"Termo"}),s.jsx(j,{children:"Privacidade"}),s.jsx(j,{className:"text-right",children:"Ações"})]})}),s.jsx(u,{children:H?s.jsx(h,{children:s.jsx(p,{colSpan:8,className:"text-center py-8",children:"Carregando..."})}):0===se?.length?s.jsx(h,{children:s.jsx(p,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"Nenhuma extensão encontrada"})}):se?.map(e=>s.jsxs(h,{children:[s.jsx(p,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[e.logo?s.jsx("img",{src:e.logo,alt:e.name,className:"w-9 h-9 rounded object-contain bg-primary/10 p-1 shrink-0"}):e.image?s.jsx("img",{src:e.image,alt:e.name,className:"w-9 h-9 rounded object-contain bg-muted p-1 shrink-0"}):s.jsx("div",{className:"w-9 h-9 rounded bg-muted shrink-0"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:e.name}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:["/",e.slug]})]})]})}),s.jsx(p,{children:e.platform||"-"}),s.jsx(p,{children:e.price_info||"-"}),s.jsx(p,{children:s.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[s.jsx(T,{className:"h-4 w-4"}),s.jsx("span",{className:"font-medium",children:e.view_count.toLocaleString("pt-BR")})]})}),s.jsx(p,{children:ae(e.status)}),s.jsx(p,{children:"published"===W.get(e.id)?s.jsx(b,{className:"bg-green-500/20 text-green-400 border-green-500/30",children:"Publicado"}):W.has(e.id)?s.jsx(b,{variant:"secondary",children:"Rascunho"}):s.jsx(b,{variant:"outline",className:"text-muted-foreground",children:"—"})}),s.jsx(p,{children:"published"===Y.get(e.id)?s.jsx(b,{className:"bg-green-500/20 text-green-400 border-green-500/30",children:"Publicado"}):Y.has(e.id)?s.jsx(b,{variant:"secondary",children:"Rascunho"}):s.jsx(b,{variant:"outline",className:"text-muted-foreground",children:"—"})}),s.jsx(p,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(n,{variant:"ghost",size:"icon",title:"Abrir Termo de Uso",onClick:()=>window.open(`/extensoes/${e.slug}/termo-de-uso`,"_blank"),children:s.jsx(B,{className:"h-4 w-4"})}),s.jsx(n,{variant:"ghost",size:"icon",title:"Abrir Política de Privacidade",onClick:()=>window.open(`/extensoes/${e.slug}/politica-de-privacidade`,"_blank"),children:s.jsx(K,{className:"h-4 w-4"})}),s.jsx(n,{variant:"ghost",size:"icon",title:"Construir/Editar guia de ajuda",onClick:()=>G(`/admin/extensions/${e.slug}/guide`),children:s.jsx(M,{className:"h-4 w-4"})}),s.jsx(n,{variant:"ghost",size:"icon",title:"Editar extensão",onClick:()=>G(`/admin/extensions/${e.id}/edit`),children:s.jsx(R,{className:"h-4 w-4"})}),s.jsxs(y,{children:[s.jsx(k,{asChild:!0,children:s.jsx(n,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",children:s.jsx($,{className:"h-4 w-4"})})}),s.jsxs(C,{children:[s.jsxs(E,{children:[s.jsx(S,{children:"Excluir extensão?"}),s.jsx(P,{children:"Esta ação não pode ser desfeita."})]}),s.jsxs(_,{children:[s.jsx(q,{children:"Cancelar"}),s.jsx(z,{onClick:()=>ee.mutate(e.id),children:"Excluir"})]})]})]})]})})]},e.id))})]})})]})})}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.