mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-08 01:06:31 +00:00
feat: add expiry label to ExpiryCountDown component in TopupPage ✨
This commit is contained in:
@ -1,11 +1,12 @@
|
|||||||
|
import { redirect } from "next/navigation";
|
||||||
import { getPayment, getProfile } from "@/actions/payment";
|
import { getPayment, getProfile } from "@/actions/payment";
|
||||||
import CancelPaymentButton from "@/components/billing/cancel-payment-button";
|
import CancelPaymentButton from "@/components/billing/cancel-payment-button";
|
||||||
|
import ExpiryCountDown from "@/components/billing/expiry-time-countdown";
|
||||||
import ClientErrorMessage from "@/components/client-error-message";
|
import ClientErrorMessage from "@/components/client-error-message";
|
||||||
import DevicesToPay from "@/components/devices-to-pay";
|
import DevicesToPay from "@/components/devices-to-pay";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { tryCatch } from "@/utils/tryCatch";
|
import { tryCatch } from "@/utils/tryCatch";
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
export default async function PaymentPage({
|
export default async function PaymentPage({
|
||||||
params,
|
params,
|
||||||
}: {
|
}: {
|
||||||
@ -40,13 +41,24 @@ export default async function PaymentPage({
|
|||||||
{payment?.paid ? "Paid" : "Pending"}
|
{payment?.paid ? "Paid" : "Pending"}
|
||||||
</Button>
|
</Button>
|
||||||
{!payment.paid && (
|
{!payment.paid && (
|
||||||
<CancelPaymentButton paymentId={paymentId} />
|
payment.is_expired ? (
|
||||||
|
<Button
|
||||||
|
disabled
|
||||||
|
className="rounded-md opacity-100! uppercase font-semibold text-red-500 bg-red-500/20"
|
||||||
|
>
|
||||||
|
Payment Expired
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<CancelPaymentButton paymentId={paymentId} />
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{!payment.paid && (
|
||||||
|
<ExpiryCountDown expiryLabel="Payment" expiresAt={payment.expires_at} />
|
||||||
|
)}
|
||||||
<div
|
<div
|
||||||
id="user-filters"
|
id="user-device-payments"
|
||||||
className="pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start"
|
className="pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start"
|
||||||
>
|
>
|
||||||
<DevicesToPay
|
<DevicesToPay
|
||||||
|
@ -56,7 +56,7 @@ export default async function TopupPage({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!topup.paid && (
|
{!topup.paid && (
|
||||||
<ExpiryCountDown expiresAt={topup.expires_at} />
|
<ExpiryCountDown expiryLabel="Top up" expiresAt={topup.expires_at} />
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
id="user-topup-details"
|
id="user-topup-details"
|
||||||
|
Reference in New Issue
Block a user