added lang param to api

This commit is contained in:
Jelaletdin12 committed 2026-10-25 00:30:50 +05:00
1 parent 11903e23bf
commit 524733ad9f
50 files changed
+798 -361

No files matched your search

+27
View File
@@ -2,6 +2,12 @@ import { useTranslation } from "react-i18next";
import { CheckCircle2, XCircle } from "lucide-react";
import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge";
import { STATUS_ICONS, STATUS_BADGE_VARIANTS, isStatusValue, getStatusLabel } from "@/constants/statusOptions";
import {
GATEWAY_STATUS_BADGE_VARIANTS,
GATEWAY_STATUS_ICONS,
getGatewayStatusLabel,
isGatewayStatusValue,
} from "@/constants/paymentStatus";
interface StatusCellProps {
status: string;
@@ -40,3 +46,24 @@ export function ActiveStatusCell({ active, status, labelActive, labelInactive }:
/>
);
}
interface GatewayStatusCellProps {
status?: string | null;
}
export function GatewayStatusCell({ status }: GatewayStatusCellProps) {
const { t } = useTranslation();
const normalizedStatus = status || "unknown";
if (isGatewayStatusValue(normalizedStatus)) {
return (
<StatusBadge
label={getGatewayStatusLabel(normalizedStatus, t)}
variant={GATEWAY_STATUS_BADGE_VARIANTS[normalizedStatus]}
icon={GATEWAY_STATUS_ICONS[normalizedStatus]}
/>
);
}
return <StatusBadge label={normalizedStatus} variant="default" />;
}