- apps/web: test updates (Vitest/setup), playbackAnalyticsService, TrackGrid, serviceErrorHandler - veza-common: logging, metrics, traits, validation, random - veza-stream-server: audio pipeline, codecs, cache, monitoring, routes - apps/web/dist_verification: refresh build assets (content-hashed filenames) Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
import{j as e,a as j}from"./vendor-react-C9dYU-TK.js";import{c as n,S as l,B as b,C as g,n as E,u as I}from"./index-BMBS6scK.js";import{aa as L,P as v,V as G,h as M,X as P,az as O,aA as F,b as V,aB as U,D as z,_ as B,a5 as S,aC as H,aD as W,aE as _}from"./vendor-icons-BSV6HBy1.js";import{S as X}from"./input-DeoQfymd.js";import"./vendor-CjLUfV8Y.js";import"./vendor-security-DsrNJhpn.js";import"./vendor-router-Dr0ZB7zf.js";import"./vendor-tanstack-C4XaEYj2.js";import"./vendor-http-CctT3C58.js";import"./vendor-utils-D0JLFg89.js";import"./vendor-motion-CbAtAbUE.js";import"./vendor-i18n-PN7w4axr.js";const $="GEAR LOCKER",q="Manage hardware assets, documentation, and warranties.";function A({title:r=$,subtitle:a=q,onExport:d,onRegister:t,isLoading:o=!1,error:x=null,className:i}){return x?e.jsx("div",{className:n("max-w-layout-content mx-auto p-4",i),children:e.jsx("p",{className:"text-destructive font-medium",children:x})}):o?e.jsxs("div",{className:n("flex flex-col md:flex-row justify-between items-start md:items-center gap-4",i),children:[e.jsxs("div",{children:[e.jsx(l,{variant:"text",className:"h-9 w-48 mb-2"}),e.jsx(l,{variant:"text",className:"h-4 w-80"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(l,{variant:"rectangular",className:"h-10 w-28 rounded-xl"}),e.jsx(l,{variant:"rectangular",className:"h-10 w-36 rounded-xl"})]})]}):e.jsxs("div",{className:n("flex flex-col md:flex-row justify-between items-start md:items-center gap-4",i),children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-heading font-bold text-foreground mb-2",children:r}),e.jsx("p",{className:"text-muted-foreground font-mono text-sm",children:a})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(b,{variant:"ghost",icon:e.jsx(L,{className:"w-4 h-4"}),onClick:d,children:"EXPORT CSV"}),e.jsx(b,{variant:"glass",icon:e.jsx(v,{className:"w-4 h-4"}),onClick:t,children:"REGISTER GEAR"})]})]})}const K=["All","Synth","Interface","Microphone","Active","Maintenance","Sold"];function D({search:r,onSearchChange:a,filter:d,onFilterChange:t,searchPlaceholder:o="Search brand, model, serial...",isLoading:x=!1,error:i=null,className:m}){return i?e.jsx("div",{className:n("p-4 rounded-xl border border-border bg-muted/30",m),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:i})}):x?e.jsxs("div",{className:n("flex flex-col md:flex-row gap-4 items-center bg-muted/30 p-4 rounded-xl border border-border",m),children:[e.jsx(l,{variant:"rectangular",className:"h-11 w-full md:w-64 rounded-xl"}),e.jsx("div",{className:"flex gap-2 w-full md:w-auto",children:[1,2,3,4].map(s=>e.jsx(l,{variant:"rectangular",className:"h-9 w-20 rounded-lg"},s))})]}):e.jsxs("div",{className:n("flex flex-col md:flex-row gap-4 items-center bg-muted/30 p-4 rounded-xl border border-border",m),children:[e.jsx("div",{className:"w-full md:w-64",children:e.jsx(X,{placeholder:o,value:r,onChange:s=>a(s.target.value)})}),e.jsx("div",{className:"flex gap-2 overflow-x-auto w-full md:w-auto pb-2 md:pb-0",children:K.map(s=>e.jsx("button",{type:"button",onClick:()=>t(s),className:n("px-4 py-1.5 rounded-lg text-xs font-bold uppercase tracking-wider transition-colors border shrink-0",d===s?"bg-primary text-primary-foreground border-primary":"bg-background text-muted-foreground border-transparent hover:border-border"),children:s},s))})]})}function T(r){if(!r)return{label:"Unknown",color:"text-muted-foreground",bg:"bg-muted"};const a=new Date(r),d=new Date,t=Math.ceil((a.getTime()-d.getTime())/(1e3*60*60*24));return t<0?{label:"Expired",color:"text-destructive",bg:"bg-destructive/10"}:t<90?{label:`Expiring (${t}d)`,color:"text-warning",bg:"bg-warning/10"}:{label:"Active",color:"text-success",bg:"bg-success/10"}}function C({item:r,onClick:a,className:d}){const t=T(r.warrantyExpire),o=r.status==="Active"?"bg-green-600/10 text-green-600":"bg-amber-500/10 text-amber-500";return e.jsxs(g,{variant:"glass",className:n("group cursor-pointer hover:border-border transition-colors",d),onClick:a,children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsx(E,{label:r.category,variant:"terminal"}),e.jsx("div",{className:n("px-2 py-0.5 rounded text-xs font-bold uppercase",o),children:r.status})]}),e.jsxs("div",{className:"flex gap-4 mb-4",children:[e.jsx("div",{className:"w-24 h-24 bg-muted rounded-lg border border-border overflow-hidden flex-shrink-0",children:r.image?e.jsx("img",{src:r.image,loading:"lazy",className:"w-full h-full object-cover opacity-80 group-hover:opacity-100 transition-opacity",alt:""}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground text-xs",children:"No image"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg font-bold text-foreground truncate",children:r.name}),e.jsx("p",{className:"text-primary text-sm font-mono mb-1",children:r.brand}),e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["S/N: ",r.serialNumber??"—"]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("span",{className:n("w-2 h-2 rounded-full",t.bg)}),e.jsxs("span",{className:n("text-xs font-bold",t.color),children:[t.label," Warranty"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-4 pt-4 border-t border-border",children:[e.jsxs("div",{className:"text-center p-2 bg-muted/50 rounded",children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase",children:"Purchased"}),e.jsx("div",{className:"text-sm font-bold text-foreground",children:r.purchaseDate})]}),e.jsxs("div",{className:"text-center p-2 bg-muted/50 rounded",children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase",children:"Condition"}),e.jsx("div",{className:"text-sm font-bold text-foreground",children:r.condition})]})]})]})}const J=6;function R({count:r=J,mode:a="grid",className:d}){return a==="list"?e.jsx("div",{className:n("space-y-2",d),children:Array.from({length:r}).map((t,o)=>e.jsxs("div",{className:"flex gap-4 p-4 rounded-xl border border-border bg-card",children:[e.jsx(l,{variant:"rectangular",className:"w-24 h-24 rounded-lg shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(l,{variant:"text",className:"h-5 w-32"}),e.jsx(l,{variant:"text",className:"h-4 w-24"}),e.jsx(l,{variant:"text",className:"h-3 w-40"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(l,{variant:"rectangular",className:"h-8 w-16 rounded"}),e.jsx(l,{variant:"rectangular",className:"h-8 w-16 rounded"})]})]},o))}):e.jsx("div",{className:n("grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",d),children:Array.from({length:r}).map((t,o)=>e.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(l,{variant:"rectangular",className:"h-6 w-16 rounded"}),e.jsx(l,{variant:"rectangular",className:"h-6 w-16 rounded"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(l,{variant:"rectangular",className:"w-24 h-24 rounded-lg shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(l,{variant:"text",className:"h-5 w-full"}),e.jsx(l,{variant:"text",className:"h-4 w-2/3"}),e.jsx(l,{variant:"text",className:"h-3 w-1/2"}),e.jsx(l,{variant:"text",className:"h-3 w-24"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-4 border-t border-border",children:[e.jsx(l,{variant:"rectangular",className:"h-14 rounded"}),e.jsx(l,{variant:"rectangular",className:"h-14 rounded"})]})]},o))})}function k({items:r,viewMode:a="grid",onItemSelect:d,onAddNew:t,isLoading:o=!1,error:x=null,emptyMessage:i="No gear found.",skeletonCount:m=6,className:s}){if(x)return e.jsx("div",{className:n("min-h-layout-page-sm flex items-center justify-center text-muted-foreground",s),children:e.jsx("p",{children:x})});if(o)return e.jsx(R,{count:m,mode:a,className:s});const u=r.length>0&&a==="list"?e.jsx("div",{className:"space-y-2",children:r.map(c=>e.jsx(C,{item:c,onClick:()=>d?.(c)},c.id))}):r.length>0?r.map(c=>e.jsx(C,{item:c,onClick:()=>d?.(c)},c.id)):null,h=a==="grid";return e.jsxs("div",{className:n(h?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8":"flex flex-col gap-2",s),children:[r.length===0&&h?e.jsx("div",{className:n("min-h-layout-page-sm flex items-center justify-center text-muted-foreground col-span-full",s),children:e.jsx("p",{children:i})}):r.length===0&&!h?e.jsx("div",{className:n("min-h-layout-page-sm flex items-center justify-center text-muted-foreground",s),children:e.jsx("p",{children:i})}):u,h&&e.jsxs("button",{type:"button",className:"appearance-none bg-transparent text-inherit font-inherit border-2 border-dashed border-border rounded-xl flex flex-col items-center justify-center p-8 hover:bg-muted/30 transition-colors cursor-pointer text-muted-foreground hover:text-foreground hover:border-primary/50 min-h-72 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background w-full",onClick:t,children:[e.jsx(v,{className:"w-12 h-12 mb-4 opacity-50"}),e.jsx("span",{className:"font-mono font-bold",children:"REGISTER NEW HARDWARE"})]}),a==="list"&&e.jsxs("button",{type:"button",onClick:t,className:"appearance-none bg-transparent border border-dashed border-border rounded-xl flex flex-col items-center justify-center p-8 min-h-24 cursor-pointer hover:bg-muted/30 w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[e.jsx(v,{className:"w-8 h-8 mb-2 opacity-50"}),e.jsx("span",{className:"font-mono text-sm font-bold",children:"REGISTER NEW HARDWARE"})]})]})}function Q({item:r,onClose:a,onSellOnMarketplace:d,onLogMaintenance:t,onContactSupport:o,onUploadDocument:x,className:i}){const m=T(r.warrantyExpire);return e.jsxs("div",{className:n("fixed inset-0 z-50 flex items-center justify-center p-4",i),children:[e.jsx("div",{className:"absolute inset-0 bg-background/90 backdrop-blur-sm",onClick:a,"aria-hidden":!0}),e.jsxs("div",{className:"relative w-full max-w-5xl bg-card border border-border rounded-2xl shadow-2xl overflow-hidden flex flex-col max-h-screen",children:[e.jsxs("div",{className:"p-8 border-b border-border bg-muted/30 flex justify-between items-start shrink-0",children:[e.jsxs("div",{className:"flex gap-8",children:[e.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg overflow-hidden border border-border shrink-0",children:r.image?e.jsx("img",{src:r.image,loading:"lazy",className:"w-full h-full object-cover",alt:""}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground text-sm",children:"No image"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-1",children:[e.jsx(E,{label:r.category,variant:"cyan"}),e.jsx("span",{className:"text-muted-foreground text-xs font-mono uppercase",children:r.serialNumber??"—"})]}),e.jsx("h2",{className:"text-3xl font-heading font-bold text-foreground",children:r.name}),e.jsxs("h3",{className:"text-xl text-primary font-medium mb-4",children:[r.brand," ",r.model]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(b,{variant:"glass",size:"sm",icon:e.jsx(G,{className:"w-4 h-4"}),onClick:()=>d?.(r),children:"SELL ON MARKETPLACE"}),e.jsx(b,{variant:"secondary",size:"sm",icon:e.jsx(M,{className:"w-4 h-4"}),onClick:()=>t?.(r),children:"LOG MAINTENANCE"})]})]})]}),e.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground p-1","aria-label":"Close",children:e.jsx(P,{className:"w-6 h-6"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-8 min-h-0",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs(g,{variant:"default",children:[e.jsxs("h4",{className:"flex items-center gap-2 font-bold text-foreground mb-4 border-b border-border pb-2",children:[e.jsx(O,{className:"w-4 h-4 text-muted-foreground"})," Specifications"]}),e.jsx("div",{className:"grid grid-cols-2 gap-y-4 gap-x-8",children:r.specs&&Object.keys(r.specs).length>0?Object.entries(r.specs).map(([s,u])=>e.jsxs("div",{className:"flex justify-between border-b border-border pb-1",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:s}),e.jsx("span",{className:"text-foreground text-sm font-medium",children:u})]},s)):e.jsx("p",{className:"text-muted-foreground italic col-span-2",children:"No specs available."})})]}),e.jsxs(g,{variant:"default",children:[e.jsxs("h4",{className:"flex items-center gap-2 font-bold text-foreground mb-4 border-b border-border pb-2",children:[e.jsx(F,{className:"w-4 h-4 text-amber-500"})," Maintenance & Support (SAV)"]}),r.status==="Maintenance"&&r.notes&&e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 p-4 rounded mb-4 flex items-center gap-4",children:[e.jsx(V,{className:"w-5 h-5 text-amber-500 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-amber-500",children:"Currently in Repair"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:r.notes})]})]}),e.jsxs("div",{className:"space-y-4",children:[r.maintenanceHistory?.map(s=>e.jsxs("div",{className:"flex items-start gap-4 p-4 bg-muted/30 rounded hover:bg-muted/50 transition-colors",children:[e.jsx("div",{className:"bg-muted p-2 rounded text-muted-foreground shrink-0",children:e.jsx(U,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"font-bold text-foreground text-sm",children:s.type}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:s.date})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s.notes}),s.cost!=null&&e.jsxs("div",{className:"text-xs text-destructive mt-1 font-mono",children:["Cost: $",s.cost]})]})]},s.id)),(!r.maintenanceHistory||r.maintenanceHistory.length===0)&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No maintenance history recorded."})]})]})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs(g,{variant:"glass",children:[e.jsxs("h4",{className:"flex items-center gap-2 font-bold text-foreground mb-4 border-b border-border pb-2",children:[e.jsx(z,{className:"w-4 h-4 text-primary"})," Purchase Info"]}),e.jsxs("div",{className:"space-y-4 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Price Paid"}),e.jsxs("span",{className:"text-foreground font-mono",children:[r.currency," ",r.purchasePrice]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Date"}),e.jsx("span",{className:"text-foreground",children:r.purchaseDate})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Vendor"}),e.jsx("span",{className:"text-foreground",children:r.vendor??"—"})]}),r.orderNumber&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Order #"}),e.jsx("span",{className:"text-muted-foreground font-mono",children:r.orderNumber})]})]})]}),e.jsxs(g,{variant:"default",children:[e.jsxs("h4",{className:"flex items-center gap-2 font-bold text-foreground mb-4 border-b border-border pb-2",children:[e.jsx(B,{className:"w-4 h-4 text-green-600"})," Warranty"]}),e.jsxs("div",{className:n("p-4 rounded text-center mb-4",m.bg),children:[e.jsx("div",{className:n("text-lg font-bold",m.color),children:m.label}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Expires: ",r.warrantyExpire??"N/A"]})]}),r.supportContact&&e.jsx(b,{variant:"ghost",size:"sm",className:"w-full text-xs",onClick:()=>o?.(r),children:"Contact Support"})]}),e.jsxs(g,{variant:"default",children:[e.jsxs("h4",{className:"flex items-center gap-2 font-bold text-foreground mb-4 border-b border-border pb-2",children:[e.jsx(S,{className:"w-4 h-4 text-muted-foreground"})," Documentation"]}),e.jsxs("div",{className:"space-y-2",children:[r.documents?.map((s,u)=>e.jsxs("div",{className:"flex items-center justify-between p-2 hover:bg-muted/50 rounded cursor-pointer group",children:[e.jsxs("div",{className:"flex items-center gap-4 overflow-hidden min-w-0",children:[s.type==="manual"?e.jsx(S,{className:"w-4 h-4 text-muted-foreground shrink-0"}):e.jsx(H,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("span",{className:"text-sm text-foreground truncate",children:s.name})]}),e.jsx(L,{className:"w-4 h-4 text-muted-foreground group-hover:text-foreground shrink-0"})]},u)),e.jsxs(b,{variant:"ghost",size:"sm",className:"w-full mt-2 text-xs border border-dashed border-border",onClick:()=>x?.(r),children:[e.jsx(v,{className:"w-3 h-3 mr-1"})," Upload Document"]})]})]})]})]})})]})]})}const Y=[{id:"1",name:"Prophet-6",category:"Synth",brand:"Sequential",model:"Prophet-6 Desktop",serialNumber:"SQ-P6-99281",purchaseDate:"2023-01-15",purchasePrice:2499,currency:"USD",status:"Active",condition:"Mint",vendor:"Sweetwater",orderNumber:"SW-8821002",warrantyExpire:"2025-01-15",warrantyType:"Manufacturer",supportContact:"support@sequential.com",image:"https://picsum.photos/id/100/400/400",specs:{Polyphony:"6 Voices",Oscillators:"2 Discrete VCOs",Filter:"Low-pass + High-pass",Sequencer:"64-step"},documents:[{name:"User Manual",type:"manual",url:"#",size:"4.2 MB"},{name:"Purchase Receipt",type:"receipt",url:"#",size:"150 KB"}]},{id:"2",name:"Apollo Twin X",category:"Interface",brand:"Universal Audio",model:"Twin X Duo",serialNumber:"UA-TWX-2210",purchaseDate:"2022-11-20",purchasePrice:999,currency:"USD",status:"Active",condition:"Good",vendor:"Thomann",warrantyExpire:"2023-11-20",warrantyType:"Manufacturer",image:"https://picsum.photos/id/101/400/400",specs:{Inputs:"2 Mic/Line",Outputs:"4 Line",Connection:"Thunderbolt 3",DSP:"Duo Core"},documents:[{name:"Firmware v1.2",type:"firmware",url:"#",size:"120 MB"}],maintenanceHistory:[{id:"m1",date:"2023-05-10",type:"Cleaning",notes:"Potentiometer de-oxidizing",cost:0}]},{id:"3",name:"SM7B",category:"Microphone",brand:"Shure",model:"SM7B Dynamic",serialNumber:"SH-SM7-004",purchaseDate:"2021-05-10",purchasePrice:399,currency:"USD",status:"Maintenance",condition:"Fair",vendor:"Guitar Center",warrantyExpire:"2023-05-10",warrantyType:"None",image:"https://picsum.photos/id/102/400/400",notes:"XLR connector feels loose. Sent for repair.",maintenanceHistory:[{id:"m2",date:"2024-02-15",type:"Repair",notes:"XLR Jack Replacement",cost:45,provider:"Local Shop"}]}];function Z(r={}){const{itemsOverride:a,isLoading:d=!1,error:t=null}=r,[o,x]=j.useState("All"),[i,m]=j.useState(""),[s,u]=j.useState("grid"),[h,c]=j.useState(null),N=a!==void 0?a??[]:Y,w=j.useMemo(()=>N.filter(p=>{const y=o==="All"||p.category===o||p.status===o,f=p.name.toLowerCase().includes(i.toLowerCase())||p.brand.toLowerCase().includes(i.toLowerCase());return y&&f}),[N,o,i]);return{filter:o,setFilter:x,search:i,setSearch:m,viewMode:s,setViewMode:u,selectedItem:h,setSelectedItem:c,filteredInventory:w,isLoading:d,error:t}}function ee(){return e.jsxs("div",{className:"space-y-8 animate-fadeIn relative max-w-layout-content mx-auto px-4 md:px-6",children:[e.jsx(A,{isLoading:!0}),e.jsx(D,{search:"",onSearchChange:()=>{},filter:"All",onFilterChange:()=>{},isLoading:!0}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:"View"}),e.jsx("div",{className:"h-9 w-20 rounded-lg bg-muted"})]}),e.jsx(R,{count:6,mode:"grid"})]})}function re({viewMode:r,onViewModeChange:a}){return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:"View"}),e.jsxs("div",{className:"flex gap-1 bg-muted p-1 rounded-lg border border-border",children:[e.jsx("button",{type:"button",onClick:()=>a("grid"),className:n("p-1.5 rounded transition-colors",r==="grid"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),"aria-label":"Grid view",children:e.jsx(W,{className:"w-4 h-4"})}),e.jsx("button",{type:"button",onClick:()=>a("list"),className:n("p-1.5 rounded transition-colors",r==="list"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),"aria-label":"List view",children:e.jsx(_,{className:"w-4 h-4"})})]})]})}const he=({itemsOverride:r,isLoading:a,error:d})=>{const{addToast:t}=I(),{filter:o,setFilter:x,search:i,setSearch:m,viewMode:s,setViewMode:u,selectedItem:h,setSelectedItem:c,filteredInventory:N,isLoading:w,error:p}=Z({itemsOverride:r,isLoading:a,error:d}),y=f=>{t(`Draft listing created for ${f.brand} ${f.name}`,"success"),c(null)};return w?e.jsx(ee,{}):e.jsxs("div",{className:"space-y-8 animate-fadeIn relative max-w-layout-content mx-auto px-4 md:px-6",children:[e.jsx(A,{onExport:()=>t("Exporting Inventory CSV..."),onRegister:()=>t("Opens Registration Form"),error:p}),p?e.jsx(k,{items:[],viewMode:s,error:p,onItemSelect:c,onAddNew:()=>t("Opens Registration Form")}):e.jsxs(e.Fragment,{children:[e.jsx(D,{search:i,onSearchChange:m,filter:o,onFilterChange:x}),e.jsx(re,{viewMode:s,onViewModeChange:u}),e.jsx(k,{items:N,viewMode:s,onItemSelect:c,onAddNew:()=>t("Opens Registration Form")}),h&&e.jsx(Q,{item:h,onClose:()=>c(null),onSellOnMarketplace:y,onLogMaintenance:()=>t("Maintenance Log Updated"),onContactSupport:f=>t(`Contacting ${f.supportContact}`),onUploadDocument:()=>t("Upload document")})]})]})};export{he as GearView};
|