import type React from "react"; import { Link } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { Database, AlertTriangle, Eye, ExternalLink } from "lucide-react"; import { Skeleton } from "@/components/ui/skeleton"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"; import { useGetOnlinePaymentDetail, useGetOnlinePaymentById } from "@/features/onlinePaymentHistory/hooks/useOnlinePaymentsHistory"; import { GatewayStatusBadge, PaidBadge } from "@/features/onlinePaymentHistory/components/PaymentStatusBadge"; import { formatFromApiDate } from "@/lib/utils/dateUtils"; import { rawEnumKey } from "@/constants/enumLabels"; function resolveLang(lang: string): "en" | "ru" | "tm" { if (lang === "ru") return "ru"; if (lang === "tk") return "tm"; return "en"; } interface PaymentDetailDialogProps { paymentId: number | null; open: boolean; onOpenChange: (open: boolean) => void; } export function PaymentDetailDialog({ paymentId, open, onOpenChange }: PaymentDetailDialogProps) { const { t, i18n } = useTranslation(); const lang = resolveLang(i18n.language); const { data, isLoading, isError } = useGetOnlinePaymentDetail(paymentId ?? 0); return ( ); } // ─── Shared Row helper ──────────────────────────────────────────────────────── function Row({ label, children }: { label: string; children: React.ReactNode }) { return (