add availableIncome and totalIncome info

This commit is contained in:
smanylov
2026-02-24 17:47:50 +07:00
parent 021ca69e6b
commit 92bd3fdcdb
@@ -1,6 +1,28 @@
'use client'
import PaymentsHistory from '@/app/ui/referral-page/table/payments-history';
import { useQuery } from '@tanstack/react-query';
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
export default function IncomeAndPayments() {
const {
data: activeInvites,
error: activeInvitesError
} = useQuery({
queryKey: ['referralUserStats'],
queryFn: () => {
return fetchReferralUserStats();
},
select: (data) => {
console.log(data);
if (data?.referralLink) {
return data
} else {
return null
};
}
});
return (
<div className="block-wrapper income-and-payments">
<div className="section-title">
@@ -12,7 +34,7 @@ export default function IncomeAndPayments() {
<div className="earning-card success">
<h4>💰 Доступно к выводу</h4>
<p>
0
{activeInvites?.availableIncome ?? 0}
</p>
<small>Минимальная сумма вывода: 100 Б</small>
</div>
@@ -20,7 +42,7 @@ export default function IncomeAndPayments() {
<div className="earning-card">
<h4>📈 Всего заработано</h4>
<p>
0
{activeInvites?.totalIncome ?? 0}
</p>
<small>За все время участия в программе</small>
</div>