update add new kind N

This commit is contained in:
wayanrivan
2025-04-25 11:34:21 +07:00
parent 97996a99dc
commit daae143823
5 changed files with 12 additions and 6 deletions

View File

@ -252,14 +252,14 @@ const DashboardHomePage = () => {
<Card
title="Registered Users"
total={responseStatisticCard?.data.total_registered ?? 0}
growth={responseStatisticCard?.data.registered_last_week.percent ?? 0}
growth={parseFloat((responseStatisticCard?.data?.registered_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.registered_last_week.surplus ?? false}
icon="test"
/>
<Card
title="Unregistered Users"
total={responseStatisticCard?.data.total_unregistered ?? 0}
growth={responseStatisticCard?.data.unregistered_last_week.percent ?? 0}
growth={parseFloat((responseStatisticCard?.data?.unregistered_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.unregistered_last_week.surplus ?? false}
icon="test"
@ -267,28 +267,28 @@ const DashboardHomePage = () => {
<Card
title="Total Cash-in"
total={responseStatisticCard?.data.total_cash_in ?? 0}
growth={responseStatisticCard?.data.cash_in_last_week.percent ?? 0}
growth={parseFloat((responseStatisticCard?.data?.cash_in_last_week.percent ?? 0).toFixed(2))?? 0}
surplus={responseStatisticCard?.data.cash_in_last_week.surplus ?? false}
icon="test"
/>
<Card
title="Total Cash-out"
total={responseStatisticCard?.data.total_cash_out ?? 0}
growth={responseStatisticCard?.data.cash_out_last_week.percent ?? 0}
growth={parseFloat((responseStatisticCard?.data?.cash_out_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.cash_out_last_week.surplus ?? false}
icon="test"
/>
<Card
title="Active Event"
total={responseStatisticCard?.data.total_event ?? 0}
growth={responseStatisticCard?.data.event_last_week.percent ?? 0}
growth={parseFloat((responseStatisticCard?.data?.event_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.event_last_week.surplus ?? false}
icon="test"
/>
<Card
title="Total Billing"
total={responseStatisticCard?.data.total_billing ?? 0}
growth={responseStatisticCard?.data.billing_last_week.percent ?? 0}
growth={parseFloat((responseStatisticCard?.data?.billing_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.billing_last_week.surplus ?? false}
icon='test'
/>

View File

@ -42,6 +42,7 @@ const TransactionPieChart = ({ startdate, enddate }: Props) => {
{ name: 'Topup', value: parseFloat((responseTransactionValue?.data?.U ?? 0).toFixed(2)), color: '#9f7aea' },
{ name: 'Purchase', value: parseFloat((responseTransactionValue?.data?.P ?? 0).toFixed(2)), color: '#baf7c5' },
{ name: 'Withdraw', value: parseFloat((responseTransactionValue?.data?.W ?? 0).toFixed(2)), color: '#f56565' },
{ name: 'Top Up Partner', value: parseFloat((responseTransactionValue?.data?.N ?? 0).toFixed(2)), color: '#f7fa52' },
];
return (

View File

@ -61,6 +61,9 @@ const TransactionValue = ({ startdate, enddate }: Props) => {
case "R":
type = "Return";
break;
case "N":
type = "Top Up Partner";
break;
default:
type = "Unknown";
break;

View File

@ -144,6 +144,7 @@ const ListToolbar = () => {
<SelectItem value="W">WITHDRAW</SelectItem>
<SelectItem value="U">TOP UP</SelectItem>
<SelectItem value="R">RETURN</SelectItem>
<SelectItem value='N'>TOP UP PARTNER</SelectItem>
</SelectContent>
</Select>

View File

@ -70,6 +70,7 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => {
case 'W': return 'WITHDRAW';
case 'U': return 'TOP UP';
case 'R': return 'RETURN';
case 'N': return 'TOP UP PARTNER';
default: return '_';
}
},