1import{w as b,r as i,j as e,s as _}from"./index-D0i8hYMd.js";import{T,a as y,b as a,c as s,d as E,e as r}from"./table-DIGTWz8p.js";import{B as p}from"./badge-B6oAqNOD.js";import{B as f}from"./button-zcHhTPun.js";import{S as j}from"./skeleton-ynJkO_pk.js";import{S as A}from"./SoftwareEditPanel-Bu4wjBgi.js";import{S as P,a as B,n as g}from"./providers.functions-Ce7VFfCT.js";import{P as C}from"./plus-DZ3F1PVk.js";import{S as I}from"./star-5ZamElgX.js";import{S as R}from"./shield-DwyXvevd.js";import{P as k}from"./pencil-BdtRqk3H.js";import"./utils-DMHpy-pb.js";import"./tabs-DsXsQOYP.js";import"./index-BOlNrj_t.js";import"./index-7vDJtoFd.js";import"./index-Ba2SKVem.js";import"./index-ymPLJ0cm.js";import"./index-DcgFcJiA.js";import"./index-Cskz-VAS.js";import"./index-BEKdAPUS.js";import"./sheet-C8u0W423.js";import"./index-CE3KU_6j.js";import"./index-DeC5PLRi.js";import"./index-BaNiXiwW.js";import"./x-D3VLKdJH.js";import"./createLucideIcon-Cz6FDOJ_.js";import"./tooltip-DAH6kSdm.js";import"./index-D0bBckSs.js";import"./index-A4AwBrVv.js";import"./use-toast-Dec3KseL.js";import"./index-C0qe1A90.js";import"./input-CGkN7tOO.js";import"./label-K0GSzcB5.js";import"./textarea-Y2rKXdxW.js";import"./select-CrhpBND3.js";import"./index-BdQq_4o_.js";import"./index-gdBOc_IG.js";import"./chevron-down-NVyUsSlM.js";import"./check-BKGzuO83.js";import"./chevron-up-B9sRmAWX.js";import"./s3Upload-T_b0or9_.js";import"./sanitizeHtml-Bx8AjwhW.js";import"./building-2-dugVI4dX.js";import"./tag-CbGYKAHL.js";import"./image-Flq3Crjv.js";import"./monitor-CjI7LIgc.js";import"./loader-circle-WpTutmUo.js";import"./trash-2-DZN2oj8D.js";import"./chevron-right-DmGzYIbE.js";import"./radio-group-DdHkfmkp.js";import"./alert-dialog-DoDwQh_g.js";import"./cdnCache.functions-BEKAos42.js";import"./auth-middleware-Dyb3iIwc.js";import"./refresh-cw-Djk86oMS.js";import"./checkbox-DzChkikG.js";import"./edgeCache.functions-10kLFg2J.js";import"./separator--rk7AHa7.js";import"./folder-DNsRr4e1.js";import"./search-D-xTdJla.js";import"./sparkles-DSTZK1DV.js";import"./RichTextEditor-BS5NcZAC.js";import"./minus-DiZXt6vo.js";import"./switch-DwQGBg14.js";import"./zap-B7_94-bK.js";import"./dollar-sign-3M9O5jMZ.js";import"./heart-CjN5zWSn.js";import"./briefcase-NZZe-dDj.js";import"./map-pin-CS2Syjjh.js";import"./users-BJtzbq2A.js";import"./globe-2RRkWpBg.js";import"./upload-DXnQzUab.js";import"./save-DfzLO21h.js";import"./circle-x-XN5R3SMt.js";import"./circle-check-D6T6UI3P.js";import"./TranslationsTab-Cetg5ZqF.js";import"./arrow-left-D_nxI9ZA.js";function st(){const{companyId:o,loading:m}=b(),[n,d]=i.useState([]),[N,l]=i.useState(!0),[w,x]=i.useState(null),[S,u]=i.useState(!1),h=async()=>{if(!o){d([]),l(!1);return}l(!0);const{data:t}=await _.from("softwares").select("id, name, slug, logo_url, status, is_active, is_verified, avg_rating, review_count").eq("company_id",o).order("created_at",{ascending:!1});d(t??[]),l(!1)};if(i.useEffect(()=>{m||h()},[m,o]),m)return e.jsx(j,{className:"h-32"});if(!o)return e.jsx("p",{className:"text-muted-foreground",children:"Tu cuenta aún no tiene una empresa asignada."});if(S)return e.jsx(A,{softwareId:w,onClose:()=>{u(!1),x(null),h()}});const c=t=>{x(t),u(!0)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Mis Software"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.length," producto(s)"]})]}),e.jsxs(f,{onClick:()=>c(null),children:[e.jsx(C,{className:"h-4 w-4 mr-2"}),"Nuevo Software"]})]}),e.jsx("div",{className:"border rounded-lg overflow-hidden",children:e.jsxs(T,{children:[e.jsx(y,{children:e.jsxs(a,{children:[e.jsx(s,{className:"w-[50px]"}),e.jsx(s,{children:"Nombre"}),e.jsx(s,{children:"Rating"}),e.jsx(s,{children:"Estado"}),e.jsx(s,{children:"Verificación"}),e.jsx(s,{className:"w-[80px]"})]})}),e.jsx(E,{children:N?e.jsx(a,{children:e.jsx(r,{colSpan:6,children:e.jsx(j,{className:"h-5 w-full"})})}):n.length===0?e.jsx(a,{children:e.jsx(r,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"Aún no cargaste ningún
1software."})}):n.map(t=>e.jsxs(a,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>c(t.id),children:[e.jsx(r,{children:t.logo_url?e.jsx("img",{src:t.logo_url,alt:"",className:"w-9 h-9 rounded object-contain border"}):e.jsx("div",{className:"w-9 h-9 rounded bg-muted flex items-center justify-center text-xs font-bold",children:t.name.charAt(0)})}),e.jsxs(r,{children:[e.jsx("p",{className:"font-medium",children:t.name}),e.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:["/",t.slug]})]}),e.jsx(r,{children:t.review_count>0?e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsx(I,{className:"h-3.5 w-3.5 fill-yellow-400 text-yellow-400"}),Number(t.avg_rating).toFixed(1)," ",e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.review_count,")"]})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"â"})}),e.jsx(r,{children:e.jsx(p,{variant:"outline",className:B[g(t.status)],children:P[g(t.status)]})}),e.jsx(r,{children:t.is_verified?e.jsxs(p,{className:"bg-green-600 hover:bg-green-700 text-xs",children:[e.jsx(R,{className:"h-3 w-3 mr-1"}),"Verificado"]}
1):e.jsx(p,{variant:"outline",className:"text-xs",children:"Pendiente"})}),e.jsx(r,{children:e.jsx(f,{variant:"ghost",size:"icon",onClick:v=>{v.stopPropagation(),c(t.id)},children:e.jsx(k,{className:"h-4 w-4"})})})]},t.id))})]})})]})}export{st as component};
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.