import{jsxs as t,Fragment as v,jsx as e}from"react/jsx-runtime";import{T}from"./table-filter-CFSMxglD.js";import{T as C}from"./table-footer-lUcSaZ5Q.js";import{T as R}from"./table-header-DXTJ1r7-.js";import{a,l as o,m as l,B as F,aD as M,aE as S,aF as h,aG as g}from"./ui-components-B24mpb8o.js";import{D}from"./layout-CZk01yM3.js";import{useReactTable as _,getFilteredRowModel as P,getSortedRowModel as $,getCoreRowModel as j,flexRender as B}from"@tanstack/react-table";import{CircleDollarSign as u,Wallet as I,DollarSign as W,Plus as q}from"lucide-react";import E from"./payouts-table-columns-Bl3DcjqJ.js";import z from"./withdraw-form-BOvTNWmd.js";import"./use-lang-Cw_jKJYs.js";import"@inertiajs/react";import"./debounce-CWHP_ANh.js";import"./route-D0xh7FtZ.js";import"react";import"./table-page-size-B94DPeOD.js";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./main-Cv60h411.js";import"./theme-colors-CLpwvDr4.js";import"./appearance-zLWEcDPI.js";import"./language-79bZLpyc.js";import"./notification-BBQVVMqD.js";import"date-fns";import"./app-logo-CAnM-q9p.js";import"./input-error-BbsDx4-P.js";import"./loading-button-B_LaGOAp.js";import"./inertia-FIn3q7f1.js";const G=i=>{var c;const{payouts:m,totalEarnings:b,totalPayouts:f,pendingPayouts:x,availableForWithdrawal:N,translate:y}=i,{dashboard:r,button:p,common:w}=y,s=_({data:m.data,columns:E(i.translate),getCoreRowModel:j(),getSortedRowModel:$(),getFilteredRowModel:P()});return t(v,{children:[t("div",{className:"mb-6 grid gap-6 sm:grid-cols-2 md:grid-cols-4",children:[e(a,{children:t(o,{className:"flex items-center gap-4 p-6",children:[e("div",{className:"bg-primary/10 rounded-lg p-2",children:e(u,{className:"text-primary h-6 w-6"})}),t("div",{children:[e(l,{className:"text-base font-medium",children:r.total_earnings}),t("p",{className:"mt-1 text-2xl font-bold",children:[b," $"]})]})]})}),e(a,{children:t(o,{className:"flex items-center gap-4 p-6",children:[e("div",{className:"bg-primary/10 rounded-lg p-2",children:e(I,{className:"text-primary h-6 w-6"})}),t("div",{children:[e(l,{className:"text-base font-medium",children:r.available}),t("p",{className:"mt-1 text-2xl font-bold",children:[N," $"]})]})]})}),e(a,{children:t(o,{className:"flex items-center gap-4 p-6",children:[e("div",{className:"bg-primary/10 rounded-lg p-2",children:e(W,{className:"text-primary h-6 w-6"})}),t("div",{children:[e(l,{className:"text-base font-medium",children:r.total_payout}),t("p",{className:"mt-1 text-2xl font-bold",children:[f," $"]})]})]})}),e(a,{children:t(o,{className:"flex items-center gap-4 p-6",children:[e("div",{className:"bg-primary/10 rounded-lg p-2",children:e(u,{className:"text-primary h-6 w-6"})}),t("div",{children:[e(l,{className:"text-base font-medium",children:r.requested}),t("p",{className:"mt-1 text-2xl font-bold",children:[x," $"]})]})]})})]}),t(a,{className:"gap-0 py-0",children:[t("div",{className:"relative flex items-center justify-between",children:[e(T,{data:m,title:r.withdraw_list,globalSearch:!0,tablePageSizes:[10,15,20,25],routeName:"payouts.index",className:"w-full md:pr-3"}),e(z,{title:p.withdraw,handler:t(F,{variant:"outline",className:"absolute top-5 right-6 md:static md:mr-6 md:mb-1",children:[e(q,{}),e("span",{children:p.payout_request})]})})]}),t(M,{className:"border-border border-y",children:[e(R,{table:s}),e(S,{children:(c=s.getRowModel().rows)!=null&&c.length?s.getRowModel().rows.map(d=>e(h,{"data-state":d.getIsSelected()&&"selected",children:d.getVisibleCells().map(n=>e(g,{children:B(n.column.columnDef.cell,n.getContext())},n.id))},d.id)):e(h,{children:e(g,{className:"h-24 text-center",children:w.no_results_found})})})]}),e(C,{className:"mt-1 p-5 sm:p-7",routeName:"payouts.index",paginationInfo:m})]})]})};G.layout=i=>e(D,{children:i});export{G as default};
