mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-06 18:19:33 +00:00
Merge pull request #9 from i701/feat/wallet-topups
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m9s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m9s
feat: update Topup interface with status and paid_at fields; modify t…
This commit is contained in:
@ -93,7 +93,7 @@ export default function TopupToPay({ topup, disabled }: { topup?: Topup, disable
|
||||
</TableCaption>
|
||||
<TableBody className="">
|
||||
<TableRow>
|
||||
<TableCell>Topup created at</TableCell>
|
||||
<TableCell>Topup created</TableCell>
|
||||
<TableCell className="text-right text-muted-foreground">
|
||||
{new Date(topup?.created_at ?? "").toLocaleDateString("en-US", {
|
||||
month: "short",
|
||||
@ -106,22 +106,24 @@ export default function TopupToPay({ topup, disabled }: { topup?: Topup, disable
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>Topup expires at</TableCell>
|
||||
<TableCell>Payment received</TableCell>
|
||||
<TableCell className="text-right text-sarLinkOrange">
|
||||
{new Date(topup?.expires_at ?? "").toLocaleDateString("en-US", {
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
year: "numeric",
|
||||
minute: "2-digit",
|
||||
hour: "2-digit",
|
||||
second: "2-digit",
|
||||
})}
|
||||
{topup?.paid_at
|
||||
? new Date(topup.paid_at).toLocaleDateString("en-US", {
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
year: "numeric",
|
||||
minute: "2-digit",
|
||||
hour: "2-digit",
|
||||
second: "2-digit",
|
||||
})
|
||||
: "-"}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>MIB Reference</TableCell>
|
||||
<TableCell className="text-right">
|
||||
{topup?.mib_reference ? topup.mib_reference : "N/A"}
|
||||
{topup?.mib_reference ? topup.mib_reference : "-"}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
|
@ -60,8 +60,7 @@ export async function TopupsTable({
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Details</TableHead>
|
||||
<TableHead>Expires at</TableHead>
|
||||
<TableHead>Expired</TableHead>
|
||||
<TableHead>Status</TableHead>
|
||||
<TableHead>Amount</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@ -120,20 +119,10 @@ export async function TopupsTable({
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<span>
|
||||
{new Date(topup.expires_at).toLocaleDateString("en-US", {
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
year: "numeric",
|
||||
minute: "2-digit",
|
||||
hour: "2-digit",
|
||||
})}
|
||||
</span>
|
||||
</TableCell>
|
||||
|
||||
<TableCell>
|
||||
<span className="font-semibold pr-2">
|
||||
{topup.is_expired ? <Badge>Yes</Badge> : <Badge variant="secondary">No</Badge>}
|
||||
{topup.is_expired ? <Badge>Expired</Badge> : <Badge variant="outline">{topup.status}</Badge>}
|
||||
</span>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
|
@ -64,6 +64,8 @@ export interface Topup {
|
||||
name: string;
|
||||
};
|
||||
paid: boolean;
|
||||
status: "CANCELLED" | "PENDING" | "VERIFIED";
|
||||
paid_at: string | null;
|
||||
mib_reference: string | null;
|
||||
expires_at: string;
|
||||
is_expired: boolean;
|
||||
|
Reference in New Issue
Block a user