mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-07 00:26:31 +00:00
feat: update Topup interface with status and paid_at fields; modify table display for topup details ✨
This commit is contained in:
@ -93,7 +93,7 @@ export default function TopupToPay({ topup, disabled }: { topup?: Topup, disable
|
|||||||
</TableCaption>
|
</TableCaption>
|
||||||
<TableBody className="">
|
<TableBody className="">
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>Topup created at</TableCell>
|
<TableCell>Topup created</TableCell>
|
||||||
<TableCell className="text-right text-muted-foreground">
|
<TableCell className="text-right text-muted-foreground">
|
||||||
{new Date(topup?.created_at ?? "").toLocaleDateString("en-US", {
|
{new Date(topup?.created_at ?? "").toLocaleDateString("en-US", {
|
||||||
month: "short",
|
month: "short",
|
||||||
@ -106,22 +106,24 @@ export default function TopupToPay({ topup, disabled }: { topup?: Topup, disable
|
|||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>Topup expires at</TableCell>
|
<TableCell>Payment received</TableCell>
|
||||||
<TableCell className="text-right text-sarLinkOrange">
|
<TableCell className="text-right text-sarLinkOrange">
|
||||||
{new Date(topup?.expires_at ?? "").toLocaleDateString("en-US", {
|
{topup?.paid_at
|
||||||
month: "short",
|
? new Date(topup.paid_at).toLocaleDateString("en-US", {
|
||||||
day: "2-digit",
|
month: "short",
|
||||||
year: "numeric",
|
day: "2-digit",
|
||||||
minute: "2-digit",
|
year: "numeric",
|
||||||
hour: "2-digit",
|
minute: "2-digit",
|
||||||
second: "2-digit",
|
hour: "2-digit",
|
||||||
})}
|
second: "2-digit",
|
||||||
|
})
|
||||||
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>MIB Reference</TableCell>
|
<TableCell>MIB Reference</TableCell>
|
||||||
<TableCell className="text-right">
|
<TableCell className="text-right">
|
||||||
{topup?.mib_reference ? topup.mib_reference : "N/A"}
|
{topup?.mib_reference ? topup.mib_reference : "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableBody>
|
||||||
|
@ -60,8 +60,7 @@ export async function TopupsTable({
|
|||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Details</TableHead>
|
<TableHead>Details</TableHead>
|
||||||
<TableHead>Expires at</TableHead>
|
<TableHead>Status</TableHead>
|
||||||
<TableHead>Expired</TableHead>
|
|
||||||
<TableHead>Amount</TableHead>
|
<TableHead>Amount</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
@ -120,20 +119,10 @@ export async function TopupsTable({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</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>
|
<TableCell>
|
||||||
<span className="font-semibold pr-2">
|
<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>
|
</span>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
|
@ -64,6 +64,8 @@ export interface Topup {
|
|||||||
name: string;
|
name: string;
|
||||||
};
|
};
|
||||||
paid: boolean;
|
paid: boolean;
|
||||||
|
status: "CANCELLED" | "PENDING" | "VERIFIED";
|
||||||
|
paid_at: string | null;
|
||||||
mib_reference: string | null;
|
mib_reference: string | null;
|
||||||
expires_at: string;
|
expires_at: string;
|
||||||
is_expired: boolean;
|
is_expired: boolean;
|
||||||
|
Reference in New Issue
Block a user