mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-08 07:16:31 +00:00
feat: add radio filter for topup expiry ✨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m49s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m49s
This commit is contained in:
@ -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",
|
label: "Topup Amount",
|
||||||
name: "amount",
|
name: "amount",
|
||||||
|
@ -388,6 +388,25 @@ export default function DynamicFilter<
|
|||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
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 (
|
||||||
|
<p>
|
||||||
|
{config.label}: <span className="text-muted-foreground">{displayValue}</span>
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// For other values, display as normal
|
||||||
|
return (
|
||||||
|
<p>
|
||||||
|
{config.label}: <span className="text-muted-foreground">{stringValue}</span>
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<p>
|
<p>
|
||||||
{config.label}: <span className="text-muted-foreground">{value}</span>
|
{config.label}: <span className="text-muted-foreground">{value}</span>
|
||||||
|
@ -82,7 +82,7 @@ export async function AppSidebar({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Parental Control",
|
title: "Parental Control",
|
||||||
link: "/parental-control",
|
link: "/parental-control?page=1",
|
||||||
icon: <CreditCard size={16} />,
|
icon: <CreditCard size={16} />,
|
||||||
perm_identifier: "device",
|
perm_identifier: "device",
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user