"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react-i18next"),i=require("./useUserAccessRequests-n0TM_Vam.js"),x=require("./AccessRequestStatusBadge-CNTI7EDr.js"),r=require("lucide-react");function u(){const{t}=o.useTranslation("admin"),{requests:a,loading:c}=i.useUserAccessRequests(),l=[{label:t("accessRequests.stats.pending"),value:a.filter(s=>s.status==="Pending").length,color:"yellow"},{label:t("accessRequests.stats.approved"),value:a.filter(s=>s.status==="Approved").length,color:"green"},{label:t("accessRequests.stats.denied"),value:a.filter(s=>s.status==="Denied").length,color:"red"}],n={green:"bg-[var(--success-bg)] text-[var(--success-text)] border-[var(--success-border)]",yellow:"bg-[var(--warning-bg)] text-[var(--warning-text)] border-[var(--warning-border)]",red:"bg-[var(--error-bg)] text-[var(--error-text)] border-[var(--error-border)]"},d=()=>c?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(r.Loader2,{className:"w-8 h-8 animate-spin text-[var(--color-accent-500)]"})}):a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(r.Inbox,{className:"w-12 h-12 text-[var(--text-secondary)] mb-4"}),e.jsx("p",{className:"text-[var(--text-secondary)]",children:t("accessRequests.noRequests")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-color)] text-left text-[var(--text-secondary)]",children:[e.jsx("th",{className:"px-4 py-3 font-medium",children:t("accessRequests.table.application")}),e.jsx("th",{className:"px-4 py-3 font-medium",children:t("accessRequests.table.tenant")}),e.jsx("th",{className:"px-4 py-3 font-medium",children:t("accessRequests.table.reason")}),e.jsx("th",{className:"px-4 py-3 font-medium",children:t("accessRequests.table.requestedAt")}),e.jsx("th",{className:"px-4 py-3 font-medium",children:t("accessRequests.table.status")}),e.jsx("th",{className:"px-4 py-3 font-medium",children:t("accessRequests.table.processedAt")}),e.jsx("th",{className:"px-4 py-3 font-medium",children:t("accessRequests.table.notes")})]})}),e.jsx("tbody",{className:"divide-y divide-[var(--border-color)]",children:a.map(s=>e.jsxs("tr",{className:"hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 font-medium",children:s.applicationLabel}),e.jsx("td",{className:"px-4 py-3",children:s.tenantName||"—"}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)] max-w-[200px] truncate",children:s.reason||"—"}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)] whitespace-nowrap",children:new Date(s.requestedAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(x.AccessRequestStatusBadge,{status:s.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)] whitespace-nowrap",children:s.processedAt?new Date(s.processedAt).toLocaleDateString():"—"}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)] max-w-[200px] truncate",children:s.processingNotes||"—"})]},s.id))})]})});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:t("accessRequests.myRequests")}),e.jsx("p",{className:"text-[var(--text-secondary)]",children:t("accessRequests.myRequestsDescription")})]}),e.jsx("div",{className:"grid grid-cols-3 gap-4",children:l.map(s=>e.jsxs("div",{className:`card p-4 text-center border ${n[s.color]}`,children:[e.jsx("div",{className:"text-2xl font-bold",children:s.value}),e.jsx("div",{className:"text-sm opacity-80",children:s.label})]},s.label))}),e.jsx("div",{className:"bg-[var(--bg-secondary)] rounded-[var(--radius-card)] border border-[var(--border-color)]",children:d()})]})}exports.default=u;
//# sourceMappingURL=MyAccessRequestsPage-D-QI3gRE.js.map
