From 64b4544c2e9fd28cf8e3682bd53b3ece52cbc449 Mon Sep 17 00:00:00 2001 From: Akachukwu Date: Fri, 10 Jan 2025 03:30:03 +0100 Subject: [PATCH] Add BundleChecker feature to analyze mint address for Solana (#34) --- .../components/BundleChecker.tsx | 71 ++++++++++++++----- 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/src/features/bundle-checker/components/BundleChecker.tsx b/src/features/bundle-checker/components/BundleChecker.tsx index ca6491b9..2e95feb1 100644 --- a/src/features/bundle-checker/components/BundleChecker.tsx +++ b/src/features/bundle-checker/components/BundleChecker.tsx @@ -7,39 +7,76 @@ import { useBundleAnalysis } from '../hooks/useBundleAnalysis'; export function BundleChecker() { const [mintAddress, setMintAddress] = useState(''); const { bundles, loading, error, analyzeMint } = useBundleAnalysis(); - + return ( -
-
+
+
+ {/* Input Field */} setMintAddress(e.target.value)} placeholder="Enter mint address" - className="w-full p-2 border rounded" + className="w-full p-3 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" /> + + {/* Analyze Button */}
- + + {/* Error Message */} {error && ( -
{error}
+
+ {error} +
)} - - {bundles.map((bundle, i) => ( -
-

Bundle {i + 1}

-
Unique Wallets: {bundle.stats.uniqueWallets}
-
SOL Spent: {bundle.stats.solSpent}
-
Supply %: {bundle.stats.percentageSupply}%
-
Current Holdings: {bundle.stats.currentHoldings}
+ + {/* Bundles Display */} + {bundles.length > 0 && ( +
+ {bundles.map((bundle, i) => ( +
+

+ Bundle {i + 1} +

+
+

+ Unique Wallets:{' '} + {bundle.stats.uniqueWallets} +

+

+ SOL Spent:{' '} + {bundle.stats.solSpent} +

+

+ Supply %:{' '} + {bundle.stats.percentageSupply}% +

+

+ Current Holdings:{' '} + {bundle.stats.currentHoldings} +

+
+
+ ))}
- ))} + )} + + {/* No Bundles Message */} + {!loading && bundles.length === 0 && ( +
+ No bundles to display. Enter a mint address and analyze. +
+ )}
); }