feat(docs, agents, risk): enhance documentation, API queries, and UI components
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.
This commit is contained in:
@@ -63,7 +63,7 @@ function riskSortLabel(
|
||||
return option ? t(option.label) : value;
|
||||
}
|
||||
|
||||
export type RiskPoolListFilter = "all" | "sold_out" | "high_risk";
|
||||
export type RiskPoolListFilter = "all" | "active" | "sold_out" | "high_risk";
|
||||
|
||||
type RiskPoolsConsoleProps = {
|
||||
drawId: number;
|
||||
@@ -87,7 +87,7 @@ function resolveInitialFilter(
|
||||
if (soldOutOnly) {
|
||||
return "sold_out";
|
||||
}
|
||||
return "all";
|
||||
return "active";
|
||||
}
|
||||
|
||||
export function RiskPoolsConsole({
|
||||
@@ -96,7 +96,7 @@ export function RiskPoolsConsole({
|
||||
titleKey,
|
||||
soldOutOnly,
|
||||
initialFilter: initialFilterProp,
|
||||
defaultSort = "number_asc",
|
||||
defaultSort = "usage_desc",
|
||||
allowSortChange = true,
|
||||
}: RiskPoolsConsoleProps) {
|
||||
const { t } = useTranslation(["risk", "common"]);
|
||||
@@ -130,6 +130,7 @@ export function RiskPoolsConsole({
|
||||
per_page: perPage,
|
||||
sold_out_only: filter === "sold_out",
|
||||
high_risk_only: filter === "high_risk",
|
||||
active_only: filter === "active" && number.trim() === "",
|
||||
normalized_number: number.trim(),
|
||||
sort,
|
||||
});
|
||||
@@ -216,12 +217,15 @@ export function RiskPoolsConsole({
|
||||
<SelectValue>
|
||||
{filter === "all"
|
||||
? t("filterAll")
|
||||
: filter === "sold_out"
|
||||
? t("filterSoldOut")
|
||||
: t("filterHighRisk")}
|
||||
: filter === "active"
|
||||
? t("filterActive")
|
||||
: filter === "sold_out"
|
||||
? t("filterSoldOut")
|
||||
: t("filterHighRisk")}
|
||||
</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="active">{t("filterActive")}</SelectItem>
|
||||
<SelectItem value="all">{t("filterAll")}</SelectItem>
|
||||
<SelectItem value="sold_out">{t("filterSoldOut")}</SelectItem>
|
||||
<SelectItem value="high_risk">{t("filterHighRisk")}</SelectItem>
|
||||
|
||||
Reference in New Issue
Block a user