mirror of
				https://github.com/i701/sarlink-portal.git
				synced 2025-11-04 06:26:59 +00:00 
			
		
		
		
	chore: add skeletons to tables and loading.tsx files for routes and run formatting ♻️
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build and Push Docker Images / Build and Push Docker Images (push) Successful in 12m20s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build and Push Docker Images / Build and Push Docker Images (push) Successful in 12m20s
				
			This commit is contained in:
		@@ -1,63 +1,78 @@
 | 
			
		||||
import { Suspense } from "react";
 | 
			
		||||
import DevicesTableSkeleton from "@/components/device-table-skeleton";
 | 
			
		||||
import DynamicFilter from "@/components/generic-filter";
 | 
			
		||||
import { WalletTransactionsTable } from "@/components/wallet-transactions-table";
 | 
			
		||||
 | 
			
		||||
export default async function Wallet({
 | 
			
		||||
  searchParams,
 | 
			
		||||
	searchParams,
 | 
			
		||||
}: {
 | 
			
		||||
  searchParams: Promise<{
 | 
			
		||||
    query: string;
 | 
			
		||||
    page: number;
 | 
			
		||||
    sortBy: string;
 | 
			
		||||
    status: string;
 | 
			
		||||
  }>;
 | 
			
		||||
	searchParams: Promise<{
 | 
			
		||||
		query: string;
 | 
			
		||||
		page: number;
 | 
			
		||||
		sortBy: string;
 | 
			
		||||
		status: string;
 | 
			
		||||
	}>;
 | 
			
		||||
}) {
 | 
			
		||||
  const query = (await searchParams)?.query || "";
 | 
			
		||||
	const query = (await searchParams)?.query || "";
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    <div>
 | 
			
		||||
      <div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
 | 
			
		||||
        <h3 className="text-sarLinkOrange text-2xl">Transaction History</h3>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div
 | 
			
		||||
        id="wallet-filters"
 | 
			
		||||
        className=" pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start"
 | 
			
		||||
      >
 | 
			
		||||
        <DynamicFilter
 | 
			
		||||
          inputs={[
 | 
			
		||||
            {
 | 
			
		||||
              label: "Type",
 | 
			
		||||
              name: "transaction_type",
 | 
			
		||||
              type: "radio-group",
 | 
			
		||||
              options: [
 | 
			
		||||
                {
 | 
			
		||||
                  label: "All",
 | 
			
		||||
                  value: "",
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                  label: "Debit",
 | 
			
		||||
                  value: "debit",
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                  label: "Credit",
 | 
			
		||||
                  value: "credit",
 | 
			
		||||
                },
 | 
			
		||||
              ],
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              label: "Topup Amount",
 | 
			
		||||
              name: "amount",
 | 
			
		||||
              type: "dual-range-slider",
 | 
			
		||||
              min: 0,
 | 
			
		||||
              max: 1000,
 | 
			
		||||
              step: 10,
 | 
			
		||||
            },
 | 
			
		||||
          ]}
 | 
			
		||||
        />
 | 
			
		||||
      </div>
 | 
			
		||||
      <Suspense key={query} fallback={"loading...."}>
 | 
			
		||||
        <WalletTransactionsTable searchParams={searchParams} />
 | 
			
		||||
      </Suspense>
 | 
			
		||||
    </div>
 | 
			
		||||
  );
 | 
			
		||||
	return (
 | 
			
		||||
		<div>
 | 
			
		||||
			<div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
 | 
			
		||||
				<h3 className="text-sarLinkOrange text-2xl">Transaction History</h3>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div
 | 
			
		||||
				id="wallet-filters"
 | 
			
		||||
				className=" pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start"
 | 
			
		||||
			>
 | 
			
		||||
				<DynamicFilter
 | 
			
		||||
					inputs={[
 | 
			
		||||
						{
 | 
			
		||||
							label: "Type",
 | 
			
		||||
							name: "transaction_type",
 | 
			
		||||
							type: "radio-group",
 | 
			
		||||
							options: [
 | 
			
		||||
								{
 | 
			
		||||
									label: "All",
 | 
			
		||||
									value: "",
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									label: "Debit",
 | 
			
		||||
									value: "debit",
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									label: "Credit",
 | 
			
		||||
									value: "credit",
 | 
			
		||||
								},
 | 
			
		||||
							],
 | 
			
		||||
						},
 | 
			
		||||
						{
 | 
			
		||||
							label: "Topup Amount",
 | 
			
		||||
							name: "amount",
 | 
			
		||||
							type: "dual-range-slider",
 | 
			
		||||
							min: 0,
 | 
			
		||||
							max: 1000,
 | 
			
		||||
							step: 10,
 | 
			
		||||
						},
 | 
			
		||||
					]}
 | 
			
		||||
				/>
 | 
			
		||||
			</div>
 | 
			
		||||
			<Suspense
 | 
			
		||||
				key={query}
 | 
			
		||||
				fallback={
 | 
			
		||||
					<DevicesTableSkeleton
 | 
			
		||||
						headers={[
 | 
			
		||||
							"Description",
 | 
			
		||||
							"Amount",
 | 
			
		||||
							"Transaction Type",
 | 
			
		||||
							"View Details",
 | 
			
		||||
							"Created at",
 | 
			
		||||
						]}
 | 
			
		||||
						length={10}
 | 
			
		||||
					/>
 | 
			
		||||
				}
 | 
			
		||||
			>
 | 
			
		||||
				<WalletTransactionsTable searchParams={searchParams} />
 | 
			
		||||
			</Suspense>
 | 
			
		||||
		</div>
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user