diff --git a/src/index.css b/src/index.css index 9ad2e90..da1a0e7 100644 --- a/src/index.css +++ b/src/index.css @@ -162,3 +162,7 @@ button:focus-visible { @apply bg-background text-foreground; } } + +button { + cursor: pointer; +} diff --git a/src/pages/Earnings.tsx b/src/pages/Earnings.tsx index 9d11ffa..4de022f 100644 --- a/src/pages/Earnings.tsx +++ b/src/pages/Earnings.tsx @@ -1,22 +1,569 @@ -// src/pages/dashboard/Earnings.tsx -import ChartEarnings from "@/components/ChartEarnings"; -import React from "react"; +import React, { useState } from "react"; +import { + DollarSign, + TrendingUp, + Calendar, + CreditCard, + Download, + ArrowUpRight, + ArrowDownRight, + Wallet, + Clock, + CheckCircle, + X, + AlertCircle, +} from "lucide-react"; +import { + XAxis, + YAxis, + CartesianGrid, + Tooltip, + ResponsiveContainer, + Area, + AreaChart, +} from "recharts"; const Earnings: React.FC = () => { + const [timeframe, setTimeframe] = useState<"7d" | "30d" | "90d" | "1y">( + "30d" + ); + const [showPayoutModal, setShowPayoutModal] = useState(false); + const [payoutAmount, setPayoutAmount] = useState("890"); + const [isProcessing, setIsProcessing] = useState(false); + + const earningsData = [ + { date: "Sep 1", amount: 120 }, + { date: "Sep 5", amount: 180 }, + { date: "Sep 10", amount: 240 }, + { date: "Sep 15", amount: 210 }, + { date: "Sep 20", amount: 290 }, + { date: "Sep 25", amount: 350 }, + { date: "Sep 30", amount: 450 }, + ]; + + const transactionData = [ + { + type: "Commission", + amount: "$120", + date: "Sep 28, 2025", + status: "Completed", + ref: "REF-4521", + }, + { + type: "Bonus", + amount: "$50", + date: "Sep 25, 2025", + status: "Completed", + ref: "BONUS-892", + }, + { + type: "Commission", + amount: "$85", + date: "Sep 22, 2025", + status: "Completed", + ref: "REF-4489", + }, + { + type: "Commission", + amount: "$95", + date: "Sep 18, 2025", + status: "Pending", + ref: "REF-4455", + }, + { + type: "Commission", + amount: "$100", + date: "Sep 15, 2025", + status: "Completed", + ref: "REF-4421", + }, + ]; + + const stats = [ + { + label: "Total Earnings", + value: "$12,450", + change: "+12.5%", + trend: "up", + icon: DollarSign, + color: "from-green-500 to-emerald-600", + bgColor: "bg-green-50", + textColor: "text-green-600", + }, + { + label: "This Month", + value: "$2,340", + change: "+8.2%", + trend: "up", + icon: TrendingUp, + color: "from-blue-500 to-indigo-600", + bgColor: "bg-blue-50", + textColor: "text-blue-600", + }, + { + label: "Pending Payout", + value: "$450", + change: "Oct 15", + trend: "neutral", + icon: Clock, + color: "from-orange-500 to-amber-600", + bgColor: "bg-orange-50", + textColor: "text-orange-600", + }, + { + label: "Available Balance", + value: "$890", + change: "Ready now", + trend: "neutral", + icon: Wallet, + color: "from-purple-500 to-pink-600", + bgColor: "bg-purple-50", + textColor: "text-purple-600", + }, + ]; + + const handlePayoutRequest = () => { + setIsProcessing(true); + setTimeout(() => { + setIsProcessing(false); + setShowPayoutModal(false); + alert( + "Payout request submitted successfully! You'll receive confirmation via email." + ); + }, 2000); + }; + return ( -
- Next Payout: Oct 15, 2025 -
-- Estimated Amount: $450 -
++ Track your affiliate performance and payouts +
++ Your performance over time +
++ Your latest earnings and payouts +
++ Withdraw your earnings +
++ Minimum withdrawal: $50.00 +
+Processing Time
++ Payouts are typically processed within 24-48 hours on + business days. +
+| Name | -Date | -Earnings | -Status | -||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {r.name} | -{r.date} | -{r.earnings} | -
-
+
+ {/* Header */}
+
+
+
+ {/* Stats Grid */}
+ Referrals++ Track and manage your affiliate referrals + +
+ {stats.map((stat, idx) => (
+
+
+ {/* Referral Link Section */}
+
+
+ ))}
+
+
+
+
+
+ {stat.value}
+
+ {stat.label}
+ {stat.change}
+
+
+
+ {/* Table Section */}
+
+
+
+
+
+
+ + Your Referral Link +++ Share this link to earn commissions + +
+
+
+ {referralLink}
+
+
+
+ {/* Table Header */}
+
+
+
+ {/* Table */}
+
+
+ + Referral List ++
+
+
+
+
+
+
+
+ |
+
+
+
+ {r.name.charAt(0)}
+
+
+
+
+ {r.name}
+
+ {r.email}
+
+ |
+
+
+
+ {r.country}
+ |
+
+ |
+
+
+ {r.date}
+
+
+ {r.totalCommission}
+
+ |
+
+
+ {r.status === "Active" ? (
+ |
+
+
+ |
+ |
Already have an account?{" "} Sign in