Updated the public documentation site with improved layout and accessibility, including new sections for client integration and admin guides. Enhanced API queries by adding 'active_only' and 'group_by' parameters for better data filtering in risk management. Refined UI components for agent management, ensuring consistent styling and improved user experience across the application. Added localization support for new documentation content in English and Nepali.
32 lines
876 B
TypeScript
32 lines
876 B
TypeScript
import {
|
|
RiskPoolsConsole,
|
|
type RiskPoolListFilter,
|
|
} from "@/modules/risk/risk-pools-console";
|
|
|
|
function parsePoolFilter(raw: string | undefined): RiskPoolListFilter {
|
|
if (raw === "sold_out" || raw === "high_risk" || raw === "all" || raw === "active") {
|
|
return raw;
|
|
}
|
|
return "active";
|
|
}
|
|
|
|
export default async function AdminDrawRiskPoolsPage(props: {
|
|
params: Promise<{ drawId: string }>;
|
|
searchParams: Promise<{ filter?: string }>;
|
|
}) {
|
|
const { drawId } = await props.params;
|
|
const { filter: filterRaw } = await props.searchParams;
|
|
const id = Number(drawId);
|
|
const filter = parsePoolFilter(filterRaw);
|
|
|
|
return (
|
|
<RiskPoolsConsole
|
|
drawId={id}
|
|
titleKey="allPoolsPageTitle"
|
|
initialFilter={filter}
|
|
defaultSort={filter === "high_risk" || filter === "active" ? "usage_desc" : "number_asc"}
|
|
allowSortChange
|
|
/>
|
|
);
|
|
}
|