"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react-i18next"),o=require("./useUserAccessRequests-C_7qRrfE.js"),x=require("./AccessRequestStatusBadge-CNTI7EDr.js"),a=require("lucide-react"),r=require("./index-CVOA4qIe.js");function u(){const{t}=d.useTranslation("admin"),{requests:c,loading:n}=o.useUserAccessRequests(),l=[{label:t("accessRequests.stats.pending"),value:c.filter(s=>s.status==="Pending").length,icon:e.jsx(a.Clock,{className:"w-5 h-5"}),accent:2},{label:t("accessRequests.stats.approved"),value:c.filter(s=>s.status==="Approved").length,icon:e.jsx(a.CheckCircle,{className:"w-5 h-5"}),accent:5},{label:t("accessRequests.stats.denied"),value:c.filter(s=>s.status==="Denied").length,icon:e.jsx(a.XCircle,{className:"w-5 h-5"}),accent:1}],i=()=>n?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(a.Loader2,{className:"w-8 h-8 animate-spin text-[var(--color-accent-500)]"})}):c.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(a.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:c.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(r.PageTemplate,{title:t("accessRequests.myRequests"),subtitle:t("accessRequests.myRequestsDescription"),icon:e.jsx(a.Key,{className:"w-6 h-6"}),children:[e.jsx("div",{className:"grid grid-cols-3 gap-4",children:l.map(s=>e.jsx(r.KpiCard,{title:s.label,value:s.value,icon:s.icon,accent:s.accent},s.label))}),e.jsx("div",{className:"bg-[var(--bg-secondary)] rounded-[var(--radius-card)] border border-[var(--border-color)]",children:i()})]})}exports.default=u;
//# sourceMappingURL=MyAccessRequestsPage--Qpe-YRa.js.map
