veza/apps/web/dist_verification/assets/GearView-ZVOHN4tS.js

2 lines
21 KiB
JavaScript
Raw Normal View History

import{j as e,a as f}from"./vendor-react-yWUy5XPk.js";import{c as o,S as d,B as j,C as b,k as G,g as N,u as W}from"./index-CYK_b1Uz.js";import{aa as R,P as S,Q as z,h as B,X as H,az as $,aA as _,b as K,aB as X,F as Q,W as q,a5 as L,aC as J,aD as Y,aE as Z}from"./vendor-icons-DJFb1Tiw.js";import{S as ee}from"./input-CGdBHtsQ.js";import"./vendor-CveO81sn.js";import"./vendor-security-DsrNJhpn.js";import"./vendor-router-BNNHboN9.js";import"./vendor-tanstack-kPY9uK0s.js";import"./vendor-http-Cz8wfb0q.js";import"./vendor-utils-DtoSyhX2.js";import"./vendor-motion-B3XPS3Jc.js";import"./vendor-i18n-CMcqpBLz.js";const re="GEAR LOCKER",se="Manage hardware assets, documentation, and warranties.";function D({title:r=re,subtitle:s=se,onExport:n,onRegister:a,isLoading:l=!1,error:x=null,className:i}){return x?e.jsx("div",{className:o("max-w-layout-content mx-auto p-4",i),children:e.jsx("p",{className:"text-destructive font-medium",children:x})}):l?e.jsxs("div",{className:o("flex flex-col md:flex-row justify-between items-start md:items-center gap-4",i),children:[e.jsxs("div",{children:[e.jsx(d,{variant:"text",className:"h-9 w-48 mb-2"}),e.jsx(d,{variant:"text",className:"h-4 w-80"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(d,{variant:"rectangular",className:"h-10 w-28 rounded-xl"}),e.jsx(d,{variant:"rectangular",className:"h-10 w-36 rounded-xl"})]})]}):e.jsxs("div",{className:o("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:s})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(j,{variant:"ghost",icon:e.jsx(R,{className:"w-4 h-4"}),onClick:n,children:"EXPORT CSV"}),e.jsx(j,{variant:"glass",icon:e.jsx(S,{className:"w-4 h-4"}),onClick:a,children:"REGISTER GEAR"})]})]})}const te=["All","Synth","Interface","Microphone","Active","Maintenance","Sold"];function F({search:r,onSearchChange:s,filter:n,onFilterChange:a,searchPlaceholder:l="Search brand, model, serial...",isLoading:x=!1,error:i=null,className:m}){return i?e.jsx("div",{className:o("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:o("flex flex-col md:flex-row gap-4 items-center bg-muted/30 p-4 rounded-xl border border-border",m),children:[e.jsx(d,{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(t=>e.jsx(d,{variant:"rectangular",className:"h-9 w-20 rounded-lg"},t))})]}):e.jsxs("div",{className:o("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(ee,{placeholder:l,value:r,onChange:t=>s(t.target.value)})}),e.jsx("div",{className:"flex gap-2 overflow-x-auto w-full md:w-auto pb-2 md:pb-0",children:te.map(t=>e.jsx("button",{type:"button",onClick:()=>a(t),className:o("px-4 py-1.5 rounded-lg text-xs font-bold uppercase tracking-wider transition-colors border shrink-0",n===t?"bg-primary text-primary-foreground border-primary":"bg-background text-muted-foreground border-transparent hover:border-border"),children:t},t))})]})}function O(r){if(!r)return{label:"Unknown",color:"text-muted-foreground",bg:"bg-muted"};const s=new Date(r),n=new Date,a=Math.ceil((s.getTime()-n.getTime())/(1e3*60*60*24));return a<0?{label:"Expired",color:"text-destructive",bg:"bg-destructive/10"}:a<90?{label:`Expiring (${a}d)`,color:"text-warning",bg:"bg-warning/10"}:{label:"Active",color:"text-success",bg:"bg-success/10"}}function I({item:r,onClick:s,className:n}){const a=O(r.warrantyExpire),l=r.status==="Active"?"bg-green-600/10 text-green-600":"bg-amber-500/10 text-amber-500";return e.jsxs(b,{variant:"glass",className:o("group cursor-pointer hover:border-border transition-colors",n),onClick:s,children:[e.jsxs("div",{className:"flex items-start justify-between mb-4"