import{jsxs as a,jsx as e}from"react/jsx-runtime";import{A as v}from"./layout-CssQHtfO.js";import{Head as w,Link as C,router as b}from"@inertiajs/react";import{C as y,b as S,c as T,d as _,a as B}from"./card-Zg0WOx-j.js";import{B as k}from"./button-BvFBRYHq.js";import{T as H,a as A,b as n,c as i,d as R,e as l}from"./table-BrXe3s2z.js";import{B as I}from"./badge-CFi7bqqA.js";import{S as m,a as h,b as p,c as u,f as x}from"./select-DfhewM4T.js";import{ArrowLeft as V,Users as g,CheckCircle as j,XCircle as D}from"lucide-react";import"./app-sidebar-header-BX2s-HO_.js";import"react";import"@radix-ui/react-collapsible";import"./dropdown-menu-BP80qPHw.js";import"@radix-ui/react-dropdown-menu";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"./app-logo-icon-beRg1XGs.js";import"./fonts-CqawFh47.js";import"@radix-ui/react-slot";import"class-variance-authority";import"@radix-ui/react-dialog";import"@radix-ui/react-tooltip";import"@radix-ui/react-avatar";import"../app.js";/* empty css     */import"axios";import"sonner";import"react-dom/client";import"./toaster-DuLpwsc2.js";import"@radix-ui/react-select";const L=[{title:"Admin",href:"/admin"},{title:"Reward",href:"#"},{title:"Top Spender",href:"/admin/reward/topspender"},{title:"Claims",href:"#"}];function ue({claims:d,filters:t,months:s,years:f}){const o=(r,c)=>{b.get("/admin/reward/topspender/claims",{...t,[r]:parseInt(c)},{preserveState:!0})},N=r=>a(I,{className:{1:"bg-yellow-500 hover:bg-yellow-600 text-white",2:"bg-gray-400 hover:bg-gray-500 text-white",3:"bg-orange-600 hover:bg-orange-700 text-white"}[r]||"",children:["#",r]});return a(v,{breadcrumbs:L,children:[e(w,{title:"Claim History"}),a("div",{className:"space-y-6",children:[a("div",{className:"flex items-center gap-4",children:[e(k,{variant:"ghost",size:"sm",asChild:!0,children:a(C,{href:`/admin/reward/topspender?month=${t.month}&year=${t.year}`,children:[e(V,{className:"w-4 h-4 mr-2"}),"Back"]})}),a("div",{children:[a("h2",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[e(g,{className:"w-6 h-6"}),"Claim History"]}),e("p",{className:"text-muted-foreground",children:"View reward claim history"})]})]}),a(y,{children:[e(S,{children:a("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[a("div",{children:[e(T,{children:"Claims"}),a(_,{children:["Claims for ",s.find(r=>r.value===t.month)?.label," ",t.year]})]}),a("div",{className:"flex gap-2",children:[a(m,{value:String(t.month),onValueChange:r=>o("month",r),children:[e(h,{className:"w-[140px]",children:e(p,{placeholder:"Month"})}),e(u,{children:s.map(r=>e(x,{value:String(r.value),children:r.label},r.value))})]}),a(m,{value:String(t.year),onValueChange:r=>o("year",r),children:[e(h,{className:"w-[100px]",children:e(p,{placeholder:"Year"})}),e(u,{children:f.map(r=>e(x,{value:String(r.value),children:r.label},r.value))})]})]})]})}),e(B,{children:e("div",{className:"rounded-md border overflow-x-auto",children:a(H,{children:[e(A,{children:a(n,{children:[e(i,{className:"w-[80px]",children:"Rank"}),e(i,{children:"User"}),e(i,{children:"Character"}),e(i,{children:"Reward"}),e(i,{className:"text-center",children:"Mail Sent"}),e(i,{children:"Claimed At"})]})}),e(R,{children:d.length>0?d.map(r=>a(n,{children:[e(l,{children:N(r.rank)}),e(l,{children:a("div",{className:"flex flex-col",children:[e("span",{className:"font-medium",children:r.user_name}),a("span",{className:"text-xs text-muted-foreground",children:["ID: ",r.user_id]})]})}),e(l,{children:a("div",{className:"flex flex-col",children:[e("span",{className:"font-medium",children:r.role_name}),a("span",{className:"text-xs text-muted-foreground",children:["ID: ",r.role_id]})]})}),a(l,{children:[r.item_name," x",r.item_count]}),e(l,{className:"text-center",children:r.mail_sent?e(j,{className:"w-5 h-5 text-green-500 mx-auto"}):e(D,{className:"w-5 h-5 text-red-500 mx-auto"})}),e(l,{className:"text-muted-foreground",children:r.claimed_at})]},r.id)):e(n,{children:e(l,{colSpan:6,className:"text-center py-8",children:a("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e(g,{className:"w-8 h-8"}),e("p",{children:"No claims for this period"})]})})})})]})})})]})]})]})}export{ue as default};
