added lang param to api
This commit is contained in:
1 parent
11903e23bf
commit
524733ad9f
50 files changed
+798
-361
No files matched your search
@@ -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" />;
|
||||
}
|
||||
Reference in new issue
Block a user