diff --git a/app/(dashboard)/top-ups/page.tsx b/app/(dashboard)/top-ups/page.tsx index ad41ebc..6aaf80d 100644 --- a/app/(dashboard)/top-ups/page.tsx +++ b/app/(dashboard)/top-ups/page.tsx @@ -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", diff --git a/components/generic-filter.tsx b/components/generic-filter.tsx index 5ef3c53..f290848 100644 --- a/components/generic-filter.tsx +++ b/components/generic-filter.tsx @@ -388,6 +388,25 @@ export default function DynamicFilter<
); } + if (config.type === "radio-group") { + const stringValue = value as string; + // For true/false values, display the label instead of the value + if (stringValue === "true" || stringValue === "false") { + const option = config.options.find((opt) => opt.value === stringValue); + const displayValue = option?.label || stringValue; + return ( ++ {config.label}: {displayValue} +
+ ); + } + // For other values, display as normal + return ( ++ {config.label}: {stringValue} +
+ ); + } return (
{config.label}: {value}
diff --git a/components/ui/app-sidebar.tsx b/components/ui/app-sidebar.tsx
index a156e9d..5dc6431 100644
--- a/components/ui/app-sidebar.tsx
+++ b/components/ui/app-sidebar.tsx
@@ -82,7 +82,7 @@ export async function AppSidebar({
},
{
title: "Parental Control",
- link: "/parental-control",
+ link: "/parental-control?page=1",
icon: