From 8caa77413ea372e5cbd2980a9922d701af359c04 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Wed, 28 May 2025 04:41:37 +0100 Subject: initial commit --- src/pages/Community.tsx | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/pages/Community.tsx (limited to 'src/pages/Community.tsx') diff --git a/src/pages/Community.tsx b/src/pages/Community.tsx new file mode 100644 index 0000000..88cb74d --- /dev/null +++ b/src/pages/Community.tsx @@ -0,0 +1,50 @@ +import React, {useEffect, useState} from 'react' + +import {Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card.tsx"; +import {GRLWidgetSettings} from "@/Widget.tsx" +import {CashoutMethodsResponse, WalletApi} from "@/api" +import {CashoutMethod} from "@/models/CashoutMethod.ts"; + +const CashoutMethodPreview: React.FC<{ cashout_method: CashoutMethod }> = ({cashout_method}) => { + + console.log("CashoutMethodPreview", cashout_method) + + return ( + + + {cashout_method.name} + + + + + + + ) +} + +const CommunityPage: React.FC = ({settings}) => { + const [cashoutMethods, setCashoutMethods] = useState([]); + + useEffect(() => { + const x = new WalletApi(); + x.getCashoutMethodsProductIdCashoutMethodsGet(settings.bpid, settings.bpuid) + .then(res => { + const data: CashoutMethodsResponse = res.data; + setCashoutMethods(data.cashout_methods); + }) + .catch(err => console.log(err)); + }, []); // ← empty array means "run once" + + return ( +
+ { + cashoutMethods.map((m, index) => { + const cm = new CashoutMethod(m); + return ; + }) + } +
+ ); +} + +export {CommunityPage} \ No newline at end of file -- cgit v1.2.3