refactor: add topup expiry filter to the Topups component and simplify expired badge display in TopupsTable 🔨

This commit is contained in:
2025-07-05 20:16:39 +05:00
parent 378fb4074c
commit 5de4bb9100
2 changed files with 20 additions and 1 deletions

View File

@ -48,6 +48,25 @@ export default async function Topups({
},
],
},
{
label: "Topup Expiry",
name: "is_expired",
type: "radio-group",
options: [
{
label: "All",
value: "",
},
{
label: "Expired",
value: "true",
},
{
label: "Not Expired",
value: "false",
},
],
},
{
label: "Topup Amount",
name: "amount",

View File

@ -125,7 +125,7 @@ export async function TopupsTable({
{topup.paid ? (
<Badge className="bg-green-100 dark:bg-green-700" variant="outline">{topup.status}</Badge>
) : topup.is_expired ? (
<Badge className="text-black dark:text-white bg-yellow-100 dark:bg-yellow-700">Expired</Badge>
<Badge>Expired</Badge>
) : (
<Badge variant="outline">{topup.status}</Badge>
)}