added some url path in view pages
This commit is contained in:
@@ -1,84 +1,77 @@
|
||||
import { format } from 'date-fns'
|
||||
import { Trash2, Edit, Search, Download, XCircle, CheckCircle2, AlertCircle } from 'lucide-react'
|
||||
import { useParams, useNavigate } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { StatusBadge, type StatusBadgeVariant } from '@/components/ui/statusBadge'
|
||||
import { BentoGrid, BentoCard, InfoRow, AuditLog, type AuditRowProps } from '@/components/viewPageComponents'
|
||||
import { useSberPaymentOrder, useDeleteSberPayment } from '@/features/sberPayments/hooks/useSberPayments'
|
||||
import type { PaymentPaidStatus, PaymentStatus } from '@/features/sberPayments/api/sberPaymentsApi'
|
||||
import { useState } from 'react'
|
||||
import { ConfirmDialog } from '@/components/confirmDialog'
|
||||
import { format } from "date-fns";
|
||||
import { Trash2, Edit, Search, Download, XCircle, CheckCircle2, AlertCircle } from "lucide-react";
|
||||
import { useParams, useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge";
|
||||
import { BentoGrid, BentoCard, InfoRow, AuditLog, type AuditRowProps } from "@/components/viewPageComponents";
|
||||
import { useSberPaymentOrder, useDeleteSberPayment } from "@/features/sberPayments/hooks/useSberPayments";
|
||||
import type { PaymentPaidStatus, PaymentStatus } from "@/features/sberPayments/api/sberPaymentsApi";
|
||||
import { useState } from "react";
|
||||
import { ConfirmDialog } from "@/components/confirmDialog";
|
||||
|
||||
// ─── Status config ────────────────────────────────────────────────────────────
|
||||
|
||||
const STATUS_VARIANT: Record<PaymentStatus, StatusBadgeVariant> = {
|
||||
GARASYLYYAR: 'warning',
|
||||
KANAGATLANDYRYLAN: 'success',
|
||||
RET_EDILEN: 'error',
|
||||
}
|
||||
GARASYLYYAR: "warning",
|
||||
KANAGATLANDYRYLAN: "success",
|
||||
RET_EDILEN: "error",
|
||||
};
|
||||
|
||||
const STATUS_ICON: Record<PaymentStatus, React.ElementType> = {
|
||||
GARASYLYYAR: AlertCircle,
|
||||
GARASYLYYAR: AlertCircle,
|
||||
KANAGATLANDYRYLAN: CheckCircle2,
|
||||
RET_EDILEN: XCircle,
|
||||
}
|
||||
RET_EDILEN: XCircle,
|
||||
};
|
||||
|
||||
const STATUS_KEY_MAP: Record<PaymentStatus, string> = {
|
||||
GARASYLYYAR: 'pending',
|
||||
KANAGATLANDYRYLAN: 'approved',
|
||||
RET_EDILEN: 'rejected',
|
||||
}
|
||||
GARASYLYYAR: "pending",
|
||||
KANAGATLANDYRYLAN: "approved",
|
||||
RET_EDILEN: "rejected",
|
||||
};
|
||||
|
||||
const PAID_STATUS_VARIANT: Record<PaymentPaidStatus, StatusBadgeVariant> = {
|
||||
Tolenmedik: 'error',
|
||||
Tolendi: 'success',
|
||||
}
|
||||
Tolenmedik: "error",
|
||||
Tolendi: "success",
|
||||
};
|
||||
|
||||
const PAID_STATUS_ICON: Record<PaymentPaidStatus, React.ElementType> = {
|
||||
Tolenmedik: XCircle,
|
||||
Tolendi: CheckCircle2,
|
||||
}
|
||||
Tolendi: CheckCircle2,
|
||||
};
|
||||
|
||||
const PAID_STATUS_KEY_MAP: Record<PaymentPaidStatus, string> = {
|
||||
Tolenmedik: 'unpaid',
|
||||
Tolendi: 'paid',
|
||||
}
|
||||
Tolenmedik: "unpaid",
|
||||
Tolendi: "paid",
|
||||
};
|
||||
|
||||
function PaymentStatusBadge({ status }: { status: PaymentStatus }) {
|
||||
const { t } = useTranslation()
|
||||
const variant = STATUS_VARIANT[status]
|
||||
const Icon = STATUS_ICON[status]
|
||||
if (!variant) return <span className="text-xs text-muted-foreground">{status}</span>
|
||||
return <StatusBadge label={t(`sberPayments.status.${STATUS_KEY_MAP[status]}`)} variant={variant} icon={Icon} />
|
||||
const { t } = useTranslation();
|
||||
const variant = STATUS_VARIANT[status];
|
||||
const Icon = STATUS_ICON[status];
|
||||
if (!variant) return <span className="text-xs text-muted-foreground">{status}</span>;
|
||||
return <StatusBadge label={t(`sberPayments.status.${STATUS_KEY_MAP[status]}`)} variant={variant} icon={Icon} />;
|
||||
}
|
||||
|
||||
function PaymentPaidStatusBadge({ status }: { status: PaymentPaidStatus }) {
|
||||
const { t } = useTranslation()
|
||||
const variant = PAID_STATUS_VARIANT[status]
|
||||
const Icon = PAID_STATUS_ICON[status]
|
||||
if (!variant) return <span className="text-xs text-muted-foreground">{status}</span>
|
||||
return <StatusBadge label={t(`sberPayments.paidStatus.${PAID_STATUS_KEY_MAP[status]}`)} variant={variant} icon={Icon} />
|
||||
const { t } = useTranslation();
|
||||
const variant = PAID_STATUS_VARIANT[status];
|
||||
const Icon = PAID_STATUS_ICON[status];
|
||||
if (!variant) return <span className="text-xs text-muted-foreground">{status}</span>;
|
||||
return <StatusBadge label={t(`sberPayments.paidStatus.${PAID_STATUS_KEY_MAP[status]}`)} variant={variant} icon={Icon} />;
|
||||
}
|
||||
|
||||
// ─── Document row ─────────────────────────────────────────────────────────────
|
||||
|
||||
function DocumentRow({
|
||||
label,
|
||||
fileName,
|
||||
fileUrl,
|
||||
}: {
|
||||
label: string
|
||||
fileName: string | null
|
||||
fileUrl: string | null
|
||||
}) {
|
||||
if (!fileUrl) return (
|
||||
<InfoRow label={label}>
|
||||
<span className="text-muted-foreground/50">—</span>
|
||||
</InfoRow>
|
||||
)
|
||||
function DocumentRow({ label, fileName, fileUrl }: { label: string; fileName: string | null; fileUrl: string | null }) {
|
||||
if (!fileUrl)
|
||||
return (
|
||||
<InfoRow label={label}>
|
||||
<span className="text-muted-foreground/50">—</span>
|
||||
</InfoRow>
|
||||
);
|
||||
|
||||
const name = fileName ?? fileUrl.split('/').pop() ?? 'faýl'
|
||||
const name = fileName ?? fileUrl.split("/").pop() ?? "faýl";
|
||||
|
||||
return (
|
||||
<InfoRow label={label}>
|
||||
@@ -96,7 +89,7 @@ function DocumentRow({
|
||||
</a>
|
||||
</div>
|
||||
</InfoRow>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Skeleton ─────────────────────────────────────────────────────────────────
|
||||
@@ -116,69 +109,69 @@ function SberPaymentViewSkeleton() {
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function SberPaymentViewPage() {
|
||||
const { t } = useTranslation()
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const navigate = useNavigate()
|
||||
const [historySearch, setHistorySearch] = useState('')
|
||||
const [deleteOpen, setDeleteOpen] = useState(false)
|
||||
const { t } = useTranslation();
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const navigate = useNavigate();
|
||||
const [historySearch, setHistorySearch] = useState("");
|
||||
const [deleteOpen, setDeleteOpen] = useState(false);
|
||||
|
||||
const { data: order, isLoading } = useSberPaymentOrder(id!)
|
||||
const deleteMutation = useDeleteSberPayment()
|
||||
const { data: order, isLoading } = useSberPaymentOrder(id!);
|
||||
const deleteMutation = useDeleteSberPayment();
|
||||
|
||||
const handleDelete = async () => {
|
||||
await deleteMutation.mutateAsync(id!)
|
||||
navigate('/sber-payments')
|
||||
}
|
||||
await deleteMutation.mutateAsync(id!);
|
||||
navigate("/sber-payments");
|
||||
};
|
||||
|
||||
if (isLoading) return <SberPaymentViewSkeleton />
|
||||
if (isLoading) return <SberPaymentViewSkeleton />;
|
||||
|
||||
if (!order) {
|
||||
return (
|
||||
<div className="flex items-center justify-center h-64 text-muted-foreground text-sm">
|
||||
{t('sberPayments.notFound', 'Töleg tapylmady')}
|
||||
{t("sberPayments.notFound", "Töleg tapylmady")}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const kabulDocs = order.documents?.slice(0, 6) ?? []
|
||||
const ugradDocs = order.documents?.slice(6) ?? []
|
||||
const kabulDocs = order.documents?.slice(0, 6) ?? [];
|
||||
const ugradDocs = order.documents?.slice(6) ?? [];
|
||||
|
||||
const auditLogs: AuditRowProps[] = order.activityLog?.map((log) => ({
|
||||
id: log.id.split('-')[1] ?? log.id,
|
||||
action: log.analysisName,
|
||||
by: log.createdBy,
|
||||
target: log.target,
|
||||
status: log.status,
|
||||
date: format(new Date(log.createdAt), 'dd/MM/yyyy, HH:mm:ss') + ' GMT+5',
|
||||
})) ?? []
|
||||
const auditLogs: AuditRowProps[] =
|
||||
order.activityLog?.map((log) => ({
|
||||
id: log.id.split("-")[1] ?? log.id,
|
||||
action: log.analysisName,
|
||||
by: log.createdBy,
|
||||
target: log.target,
|
||||
status: log.status,
|
||||
date: format(new Date(log.createdAt), "dd/MM/yyyy, HH:mm:ss") + " GMT+5",
|
||||
})) ?? [];
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
|
||||
{/* ── Page header ──────────────────────────────────────────────────── */}
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
{t('sberPayments.viewTitle', 'Sberbank töleg')}: {order.id}
|
||||
{t("sberPayments.viewTitle", "Sberbank töleg")}: {order.id}
|
||||
</h1>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<button
|
||||
onClick={() => setDeleteOpen(true)}
|
||||
disabled={deleteMutation.isPending}
|
||||
className="p-2 rounded-md cursor-pointer hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50"
|
||||
title={t('common.delete', 'Poz')}
|
||||
title={t("common.delete", "Poz")}
|
||||
>
|
||||
<Trash2 size={16} />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => navigate(`/sber-payments/${id}/edit`)}
|
||||
className="p-2 rounded-md cursor-pointer hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors"
|
||||
title={t('common.edit', 'Redaktirle')}
|
||||
title={t("common.edit", "Redaktirle")}
|
||||
>
|
||||
<Edit size={16} />
|
||||
</button>
|
||||
@@ -187,80 +180,79 @@ export default function SberPaymentViewPage() {
|
||||
|
||||
{/* ── Row 1: Meta + Lokasiýa ────────────────────────────────────────── */}
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t('sberPayments.view.sections.main', 'Esasy maglumatlar')}>
|
||||
<InfoRow label={t('common.id', 'ID')} value={order.id} />
|
||||
<InfoRow label={t('Status', 'Status')}>
|
||||
<BentoCard title={t("sberPayments.view.sections.main", "Esasy maglumatlar")}>
|
||||
<InfoRow label={t("common.id", "ID")} value={order.id} />
|
||||
<InfoRow label={t("Status", "Status")}>
|
||||
<PaymentStatusBadge status={order.status} />
|
||||
</InfoRow>
|
||||
<InfoRow label={t('sberPayments.columns.paidStatus', 'Tölenen (şul aý)')}>
|
||||
<InfoRow label={t("sberPayments.columns.paidStatus", "Tölenen (şul aý)")}>
|
||||
<PaymentPaidStatusBadge status={order.paidStatus} />
|
||||
</InfoRow>
|
||||
<InfoRow label={t('sberPayments.cards.bellik', 'Bellik')} value={order.bellik} />
|
||||
<InfoRow label={t("sberPayments.cards.bellik", "Bellik")} value={order.bellik} />
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title={t('sberPayments.view.sections.location', 'Lokasiýa')}>
|
||||
<InfoRow label={t('sberPayments.fields.welayat', 'Welaýat')} value={order.welayat} />
|
||||
<InfoRow label={t('sberPayments.fields.sahamca', 'Şahamça')} value={order.sahamca} isLink />
|
||||
<BentoCard title={t("sberPayments.view.sections.location", "Lokasiýa")}>
|
||||
<InfoRow label={t("sberPayments.fields.welayat", "Welaýat")} value={order.welayat} />
|
||||
<InfoRow
|
||||
label={t("sberPayments.fields.sahamca", "Şahamça")}
|
||||
value={order.sahamca}
|
||||
isLink
|
||||
href={order.sahamcaId ? `/settings/location/branches/${order.sahamcaId}` : "/settings/location/branches"}
|
||||
/>
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
{/* ── Row 2: Şahsy maglumatlar + Töleg ─────────────────────────────── */}
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t('sberPayments.view.sections.personal', 'Şahsy maglumatlar')}>
|
||||
<InfoRow label={t('sberPayments.fields.firstName', 'Pasportdaky ady')} value={order.firstName} />
|
||||
<InfoRow label={t('sberPayments.fields.lastName', 'Pasportdaky familiýa')} value={order.lastName} />
|
||||
<InfoRow label={t('sberPayments.fields.phone', 'Telefon')} value={order.phone} />
|
||||
<InfoRow label={t('sberPayments.fields.email', 'E-poçta')} value={order.email} />
|
||||
<InfoRow label={t('sberPayments.fields.address', 'Salgy')} value={order.address} />
|
||||
<BentoCard title={t("sberPayments.view.sections.personal", "Şahsy maglumatlar")}>
|
||||
<InfoRow label={t("sberPayments.fields.firstName", "Pasportdaky ady")} value={order.firstName} />
|
||||
<InfoRow label={t("sberPayments.fields.lastName", "Pasportdaky familiýa")} value={order.lastName} />
|
||||
<InfoRow label={t("sberPayments.fields.phone", "Telefon")} value={order.phone} />
|
||||
<InfoRow label={t("sberPayments.fields.email", "E-poçta")} value={order.email} />
|
||||
<InfoRow label={t("sberPayments.fields.address", "Salgy")} value={order.address} />
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title={t('sberPayments.view.sections.payment', 'Töleg')}>
|
||||
<BentoCard title={t("sberPayments.view.sections.payment", "Töleg")}>
|
||||
<InfoRow
|
||||
label={t('sberPayments.payerInfo', 'Töleg ugradyjynyň maglumatlary')}
|
||||
value={`I-M${order.passportNumber?.slice(0, 2) ?? 'XX'}-${order.passportNumber ?? ''} ${order.fullName}`}
|
||||
label={t("sberPayments.payerInfo", "Töleg ugradyjynyň maglumatlary")}
|
||||
value={`I-M${order.passportNumber?.slice(0, 2) ?? "XX"}-${order.passportNumber ?? ""} ${order.fullName}`}
|
||||
/>
|
||||
<InfoRow label={t('sberPayments.fields.accountNumber', 'Goýum hasaby')} value={order.accountNumber} />
|
||||
<InfoRow label={t('sberPayments.fields.passportSeries', 'Pasport seriýasy')} value={order.passportSeries} />
|
||||
<InfoRow label={t('sberPayments.fields.passportNumber', 'Pasport nomeri')} value={order.passportNumber} />
|
||||
<InfoRow label={t('sberPayments.fields.fullName', 'Ady Familiýasy Atasynyň ady')} value={order.fullName} />
|
||||
<InfoRow label={t("sberPayments.fields.accountNumber", "Goýum hasaby")} value={order.accountNumber} />
|
||||
<InfoRow label={t("sberPayments.fields.passportSeries", "Pasport seriýasy")} value={order.passportSeries} />
|
||||
<InfoRow label={t("sberPayments.fields.passportNumber", "Pasport nomeri")} value={order.passportNumber} />
|
||||
<InfoRow label={t("sberPayments.fields.fullName", "Ady Familiýasy Atasynyň ady")} value={order.fullName} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
{/* ── Row 3: Kabul ediji resminamalary ─────────────────────────────── */}
|
||||
<BentoGrid cols={1}>
|
||||
<BentoCard title={t('sberPayments.view.sections.acceptedDocs', 'Kabul ediji talyp boýunça resminamalary')}>
|
||||
{kabulDocs.length > 0
|
||||
? kabulDocs.map((doc) => (
|
||||
<DocumentRow key={doc.id} label={doc.label} fileName={doc.name} fileUrl={doc.fileUrl} />
|
||||
))
|
||||
: (
|
||||
<div className="px-4 py-8 text-center text-sm text-muted-foreground">
|
||||
{t('sberPayments.view.noDocuments', 'Resminamalar ýok')}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<BentoCard title={t("sberPayments.view.sections.acceptedDocs", "Kabul ediji talyp boýunça resminamalary")}>
|
||||
{kabulDocs.length > 0 ? (
|
||||
kabulDocs.map((doc) => <DocumentRow key={doc.id} label={doc.label} fileName={doc.name} fileUrl={doc.fileUrl} />)
|
||||
) : (
|
||||
<div className="px-4 py-8 text-center text-sm text-muted-foreground">
|
||||
{t("sberPayments.view.noDocuments", "Resminamalar ýok")}
|
||||
</div>
|
||||
)}
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
{/* ── Row 4: Ugradyjy resminamalary ────────────────────────────────── */}
|
||||
<BentoGrid cols={1}>
|
||||
<BentoCard title={t('sberPayments.view.sections.sentDocs', 'Ugradyjy boýunça resminamalary')}>
|
||||
{ugradDocs.length > 0
|
||||
? ugradDocs.map((doc) => (
|
||||
<DocumentRow key={doc.id} label={doc.label} fileName={doc.name} fileUrl={doc.fileUrl} />
|
||||
))
|
||||
: (
|
||||
<div className="px-4 py-8 text-center text-sm text-muted-foreground">
|
||||
{t('sberPayments.view.noDocuments', 'Resminamalar ýok')}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<BentoCard title={t("sberPayments.view.sections.sentDocs", "Ugradyjy boýunça resminamalary")}>
|
||||
{ugradDocs.length > 0 ? (
|
||||
ugradDocs.map((doc) => <DocumentRow key={doc.id} label={doc.label} fileName={doc.name} fileUrl={doc.fileUrl} />)
|
||||
) : (
|
||||
<div className="px-4 py-8 text-center text-sm text-muted-foreground">
|
||||
{t("sberPayments.view.noDocuments", "Resminamalar ýok")}
|
||||
</div>
|
||||
)}
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
{/* ── Row 5: Töleg taryhy ───────────────────────────────────────────── */}
|
||||
<BentoGrid cols={1}>
|
||||
<BentoCard title={t('sberPayments.view.sections.paymentHistory', 'Töleg taryhy')}>
|
||||
<BentoCard title={t("sberPayments.view.sections.paymentHistory", "Töleg taryhy")}>
|
||||
<div className="p-4">
|
||||
<div className="relative max-w-xs mb-4">
|
||||
<Search size={13} className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground" />
|
||||
@@ -268,7 +260,7 @@ export default function SberPaymentViewPage() {
|
||||
type="text"
|
||||
value={historySearch}
|
||||
onChange={(e) => setHistorySearch(e.target.value)}
|
||||
placeholder={t('common.search', 'Gözlemek')}
|
||||
placeholder={t("common.search", "Gözlemek")}
|
||||
className="h-9 w-full pl-9 pr-3 rounded-md border border-border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring"
|
||||
/>
|
||||
</div>
|
||||
@@ -281,7 +273,7 @@ export default function SberPaymentViewPage() {
|
||||
<line x1="9" y1="21" x2="9" y2="9" />
|
||||
</svg>
|
||||
</div>
|
||||
<p className="text-sm">{t('sberPayments.view.noPaymentHistory', 'Berlen kriteriýalara Töleg gabat gelmedi.')}</p>
|
||||
<p className="text-sm">{t("sberPayments.view.noPaymentHistory", "Berlen kriteriýalara Töleg gabat gelmedi.")}</p>
|
||||
</div>
|
||||
</div>
|
||||
</BentoCard>
|
||||
@@ -293,11 +285,11 @@ export default function SberPaymentViewPage() {
|
||||
<ConfirmDialog
|
||||
open={deleteOpen}
|
||||
onOpenChange={setDeleteOpen}
|
||||
title={t('sberPayments.deleteDialog.title', 'Bu tölegi pozmak isleýärsiňizmi?')}
|
||||
confirmLabel={t('common.delete', 'Poz')}
|
||||
title={t("sberPayments.deleteDialog.title", "Bu tölegi pozmak isleýärsiňizmi?")}
|
||||
confirmLabel={t("common.delete", "Poz")}
|
||||
onConfirm={handleDelete}
|
||||
isLoading={deleteMutation.isPending}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,50 +2,37 @@ import { useState } from "react";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Trash2, Pencil } from "lucide-react";
|
||||
import {
|
||||
useLoanOrderMobileById,
|
||||
useDeleteLoanOrderMobile,
|
||||
} from "@/features/loanOrderMobiles/hooks/useLoanOrderMobiles";
|
||||
import { useLoanOrderMobileById, useDeleteLoanOrderMobile } from "@/features/loanOrderMobiles/hooks/useLoanOrderMobiles";
|
||||
import { CreditCardVisual } from "@/components/creditCardVisual";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import type { LoanOrderMobileStatus } from "@/features/loanOrderMobiles/api/loanOrderMobilesApi";
|
||||
import {
|
||||
StatusBadge,
|
||||
type StatusBadgeVariant,
|
||||
} from "@/components/ui/statusBadge";
|
||||
import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge";
|
||||
import { AlertCircle, CheckCircle2, XCircle } from "lucide-react";
|
||||
import {
|
||||
BentoGrid,
|
||||
BentoCard,
|
||||
InfoRow,
|
||||
PassportImage,
|
||||
AuditLog,
|
||||
type AuditRowProps,
|
||||
} from "@/components/viewPageComponents";
|
||||
import { BentoGrid, BentoCard, InfoRow, PassportImage, AuditLog, type AuditRowProps } from "@/components/viewPageComponents";
|
||||
import { ConfirmDialog } from "@/components/confirmDialog";
|
||||
|
||||
// ─── Status config ────────────────────────────────────────────────────────────
|
||||
|
||||
const STATUS_VARIANT: Record<LoanOrderMobileStatus, StatusBadgeVariant> = {
|
||||
GARAŞYLÝAR: "warning",
|
||||
GARAŞYLÝAR: "warning",
|
||||
KANAGATLANDYRYLAN: "success",
|
||||
RED_EDILDI: "error",
|
||||
IŞLENÝÄR: "warning",
|
||||
}
|
||||
RED_EDILDI: "error",
|
||||
IŞLENÝÄR: "warning",
|
||||
};
|
||||
|
||||
const STATUS_ICON: Record<LoanOrderMobileStatus, React.ElementType> = {
|
||||
GARAŞYLÝAR: AlertCircle,
|
||||
GARAŞYLÝAR: AlertCircle,
|
||||
KANAGATLANDYRYLAN: CheckCircle2,
|
||||
RED_EDILDI: XCircle,
|
||||
IŞLENÝÄR: AlertCircle,
|
||||
}
|
||||
RED_EDILDI: XCircle,
|
||||
IŞLENÝÄR: AlertCircle,
|
||||
};
|
||||
|
||||
function LoanOrderMobileStatusBadge({ status }: { status: LoanOrderMobileStatus }) {
|
||||
const { t } = useTranslation()
|
||||
const variant = STATUS_VARIANT[status]
|
||||
const Icon = STATUS_ICON[status]
|
||||
if (!variant) return <span className="text-xs text-muted-foreground">{status}</span>
|
||||
return <StatusBadge label={t(`loanOrderStatus.${status}`)} variant={variant} icon={Icon} />
|
||||
const { t } = useTranslation();
|
||||
const variant = STATUS_VARIANT[status];
|
||||
const Icon = STATUS_ICON[status];
|
||||
if (!variant) return <span className="text-xs text-muted-foreground">{status}</span>;
|
||||
return <StatusBadge label={t(`loanOrderStatus.${status}`)} variant={variant} icon={Icon} />;
|
||||
}
|
||||
|
||||
// ─── Skeleton ─────────────────────────────────────────────────────────────────
|
||||
@@ -65,57 +52,52 @@ function LoanOrderMobilesViewSkeleton() {
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Page ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function LoanOrderMobilesViewPage() {
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const deleteMutation = useDeleteLoanOrderMobile()
|
||||
const [showDeleteDialog, setShowDeleteDialog] = useState(false)
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const deleteMutation = useDeleteLoanOrderMobile();
|
||||
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
|
||||
|
||||
const { data: order, isLoading } = useLoanOrderMobileById(id!)
|
||||
const { data: order, isLoading } = useLoanOrderMobileById(id!);
|
||||
|
||||
const handleDelete = () => {
|
||||
setShowDeleteDialog(true)
|
||||
}
|
||||
setShowDeleteDialog(true);
|
||||
};
|
||||
|
||||
const confirmDelete = () => {
|
||||
deleteMutation.mutate(id!, {
|
||||
onSuccess: () => navigate("/loan-order-mobiles"),
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (isLoading) return <LoanOrderMobilesViewSkeleton />
|
||||
if (isLoading) return <LoanOrderMobilesViewSkeleton />;
|
||||
|
||||
if (!order) {
|
||||
return (
|
||||
<div className="flex items-center justify-center h-64 text-muted-foreground text-sm">
|
||||
{t("common.notFound", "Tapylmady")}
|
||||
</div>
|
||||
)
|
||||
return <div className="flex items-center justify-center h-64 text-muted-foreground text-sm">{t("common.notFound", "Tapylmady")}</div>;
|
||||
}
|
||||
|
||||
const auditLogs: AuditRowProps[] = [
|
||||
{
|
||||
id: "44548",
|
||||
id: "44548",
|
||||
action: t("audit.actions.view", "Görmek"),
|
||||
by: order.createdBy ?? "",
|
||||
by: order.createdBy ?? "",
|
||||
target: `${t("loanOrderMobiles.title", "Karz sargyt")}: ${order.id}`,
|
||||
status: "FINISHED",
|
||||
date: order.createdAt ?? "",
|
||||
date: order.createdAt ?? "",
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
const hasCard = !!(order.cardNumber || order.cardName)
|
||||
const hasGuarantor = !!(order.guarantor1Name || order.guarantor1CardNumber)
|
||||
const hasCard = !!(order.cardNumber || order.cardName);
|
||||
const hasGuarantor = !!(order.guarantor1Name || order.guarantor1CardNumber);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
|
||||
{/* ── Page header ──────────────────────────────────────────────────── */}
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
@@ -144,24 +126,13 @@ export default function LoanOrderMobilesViewPage() {
|
||||
<BentoGrid cols={3}>
|
||||
<BentoCard title={t("loanOrders.sections.meta", "Esasy maglumatlar")}>
|
||||
<InfoRow label={t("common.id", "ID")} value={order.id} />
|
||||
<InfoRow
|
||||
label={t("loanOrders.columns.status", "Status")}
|
||||
>
|
||||
<InfoRow label={t("loanOrders.columns.status", "Status")}>
|
||||
<LoanOrderMobileStatusBadge status={order.status} />
|
||||
</InfoRow>
|
||||
<InfoRow
|
||||
label={t("loanOrders.columns.createdAt", "Döredilen wagty")}
|
||||
value={order.createdAt}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.columns.branch", "Şahamça")}
|
||||
value={order.branch}
|
||||
isLink
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.note", "Bellik")}
|
||||
value={order.note || undefined}
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.columns.createdAt", "Döredilen wagty")} value={order.createdAt} />
|
||||
|
||||
<InfoRow label={t("loanOrders.fields.note", "Bellik")} value={order.note || undefined} />
|
||||
<InfoRow label={t("loanOrders.columns.createdBy", "Döreden")} value={order.createdBy} />
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title={t("loanOrders.sections.loan", "Karz")}>
|
||||
@@ -169,6 +140,7 @@ export default function LoanOrderMobilesViewPage() {
|
||||
label={t("loanOrders.columns.loanType", "Karz görnüşi")}
|
||||
value={order.loanType}
|
||||
isLink
|
||||
href={order.loanTypeId ? `/settings/loan/loan-types/${order.loanTypeId}` : "/settings/loan/loan-types"}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.loanAmount", "Karz möçberi")}
|
||||
@@ -177,9 +149,12 @@ export default function LoanOrderMobilesViewPage() {
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title={t("loanOrders.sections.location", "Lokasiýa")}>
|
||||
<InfoRow label={t("loanOrders.columns.region", "Welaýat")} value={order.region} />
|
||||
<InfoRow
|
||||
label={t("loanOrders.columns.region", "Welaýat")}
|
||||
value={order.region}
|
||||
label={t("loanOrders.columns.branch", "Şahamça")}
|
||||
value={order.branch}
|
||||
isLink
|
||||
href={order.branchId ? `/settings/location/branches/${order.branchId}` : "/settings/location/branches"}
|
||||
/>
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
@@ -197,14 +172,8 @@ export default function LoanOrderMobilesViewPage() {
|
||||
variant="primary"
|
||||
/>
|
||||
</div>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.cardNumber", "Kart belgisi")}
|
||||
value={order.cardNumber}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.cardName", "Kartdaky ady")}
|
||||
value={order.cardName}
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.fields.cardNumber", "Kart belgisi")} value={order.cardNumber} />
|
||||
<InfoRow label={t("loanOrders.fields.cardName", "Kartdaky ady")} value={order.cardName} />
|
||||
</BentoCard>
|
||||
|
||||
{/* Guarantor card — shown side-by-side with main card when both exist */}
|
||||
@@ -245,110 +214,50 @@ export default function LoanOrderMobilesViewPage() {
|
||||
label={t("loanOrders.fields.fullName", "Doly ady")}
|
||||
value={`${order.firstName} ${order.lastName} ${order.patronicName || ""}`.trim()}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.education", "Bilimi")}
|
||||
value={order.education ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.maritalStatus", "Maşgala ýagdaýy")}
|
||||
value={order.marriageStatus ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.birthDate", "Doglan güni")}
|
||||
value={order.dateOfBirth ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.registeredAddress", "Ýazgy edilen salgy")}
|
||||
value={order.residence ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.currentAddress", "Häzirki ýaşaýyş ýeri")}
|
||||
value={order.currentResidence ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.loanHistory", "Karz taryhy")}
|
||||
value={order.loanHistory ?? undefined}
|
||||
isLink
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.fields.education", "Bilimi")} value={order.education ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.maritalStatus", "Maşgala ýagdaýy")} value={order.marriageStatus ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.birthDate", "Doglan güni")} value={order.dateOfBirth ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.registeredAddress", "Ýazgy edilen salgy")} value={order.residence ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.currentAddress", "Häzirki ýaşaýyş ýeri")} value={order.currentResidence ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.loanHistory", "Karz taryhy")} value={order.loanHistory ?? undefined} isLink />
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title={t("loanOrders.sections.contacts", "Habarlaşmak")}>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.email", "E-poçta")}
|
||||
value={order.email ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.columns.phone", "Telefon")}
|
||||
value={order.phone}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.phoneAlt", "Telefon goşmaça")}
|
||||
value={order.phoneAdditional ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.homePhone", "Öý telefony")}
|
||||
value={order.homePhone ?? undefined}
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.fields.email", "E-poçta")} value={order.email ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.columns.phone", "Telefon")} value={order.phone} />
|
||||
<InfoRow label={t("loanOrders.fields.phoneAlt", "Telefon goşmaça")} value={order.phoneAdditional ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.homePhone", "Öý telefony")} value={order.homePhone ?? undefined} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
{/* ── Row 4: Employment + Passport info ───────────────────────────── */}
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrders.sections.employment", "Iş")}>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.employer", "Kärhananyň ady")}
|
||||
value={order.workCompany ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.deptPhone", "Işgärler bölüminiň belgisi")}
|
||||
value={order.workHrPhone ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.workRegion", "Işleýän welaýaty")}
|
||||
value={order.workRegion ?? undefined}
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.fields.employer", "Kärhananyň ady")} value={order.workCompany ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.deptPhone", "Işgärler bölüminiň belgisi")} value={order.workHrPhone ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.workRegion", "Işleýän welaýaty")} value={order.workRegion ?? undefined} />
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.workCity", "Işleýän etraby")}
|
||||
value={order.workProvince ?? undefined}
|
||||
isLink
|
||||
href={order.workCityId ? `/settings/location/districts/${order.workCityId}` : "/settings/location/districts"}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.position", "Wezipe")}
|
||||
value={order.position ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.salary", "Zähmet haky")}
|
||||
value={order.salary ? String(order.salary) : undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.employedSince", "Işe başlan wagty")}
|
||||
value={order.workStartedAt ?? undefined}
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.fields.position", "Wezipe")} value={order.position ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.salary", "Zähmet haky")} value={order.salary ? String(order.salary) : undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.employedSince", "Işe başlan wagty")} value={order.workStartedAt ?? undefined} />
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title={t("loanOrders.sections.passport", "Pasport")}>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.passportNumber", "Pasport")}
|
||||
value={order.passportNumber ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.passportIssuedBy", "Kim tarapyndan berildi")}
|
||||
value={order.passportGivenBy ?? undefined}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.passportBirthPlace", "Doglan ýeri (pasport)")}
|
||||
value={order.bornPlace ?? undefined}
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.fields.passportNumber", "Pasport")} value={order.passportNumber ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.passportIssuedBy", "Kim tarapyndan berildi")} value={order.passportGivenBy ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.passportBirthPlace", "Doglan ýeri (pasport)")} value={order.bornPlace ?? undefined} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
{/* ── Row 5: Passport images ───────────────────────────────────────── */}
|
||||
<BentoGrid cols={4}>
|
||||
<BentoCard title={t("loanOrders.fields.passportPage1", "Sahypa 1")}>
|
||||
<PassportImage
|
||||
label={t("loanOrders.fields.passportPage1", "Pasport (sahypa 1)")}
|
||||
src={order.passportPage1Url ?? undefined}
|
||||
/>
|
||||
<PassportImage label={t("loanOrders.fields.passportPage1", "Pasport (sahypa 1)")} src={order.passportPage1Url ?? undefined} />
|
||||
</BentoCard>
|
||||
<BentoCard title={t("loanOrders.fields.passportPage23", "Sahypa 2-3")}>
|
||||
<PassportImage
|
||||
@@ -357,10 +266,7 @@ export default function LoanOrderMobilesViewPage() {
|
||||
/>
|
||||
</BentoCard>
|
||||
<BentoCard title={t("loanOrders.fields.passportPage89", "Sahypa 8-9")}>
|
||||
<PassportImage
|
||||
label={t("loanOrders.fields.passportPage89", "Pasport (8-9 sahypa)")}
|
||||
src={order.passportPage89Url ?? undefined}
|
||||
/>
|
||||
<PassportImage label={t("loanOrders.fields.passportPage89", "Pasport (8-9 sahypa)")} src={order.passportPage89Url ?? undefined} />
|
||||
</BentoCard>
|
||||
<BentoCard title={t("loanOrders.fields.passportPage32", "Sahypa 32")}>
|
||||
<PassportImage
|
||||
@@ -413,5 +319,5 @@ export default function LoanOrderMobilesViewPage() {
|
||||
isLoading={deleteMutation.isPending}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -128,12 +128,22 @@ export default function LoanOrderViewPage() {
|
||||
<LoanOrderMobileStatusBadge status={order.status} />
|
||||
</InfoRow>
|
||||
<InfoRow label={t("loanOrders.fields.amount", "Berlik")} value={order.amount ? String(order.amount) : undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.createdBy", "Sargyt eden")} value={order.createdBy ?? undefined} isLink />
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.createdBy", "Sargyt eden")}
|
||||
value={order.createdBy ?? undefined}
|
||||
isLink
|
||||
href={order.createdById ? `/all-users/${order.createdById}` : "/all-users"}
|
||||
/>
|
||||
</BentoCard>
|
||||
|
||||
{/* Loan */}
|
||||
<BentoCard title={t("loanOrders.sections.loan", "Karz")}>
|
||||
<InfoRow label={t("loanOrders.columns.loanType", "Karz görnüşi")} value={order.loanType} isLink />
|
||||
<InfoRow
|
||||
label={t("loanOrders.columns.loanType", "Karz görnüşi")}
|
||||
value={order.loanType}
|
||||
isLink
|
||||
href={order.loanTypeId ? `/settings/loan/loan-types/${order.loanTypeId}` : "/settings/loan/loan-types"}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.loanAmount", "Karz mukdary")}
|
||||
value={order.loanAmount ? String(order.loanAmount) : undefined}
|
||||
@@ -143,7 +153,12 @@ export default function LoanOrderViewPage() {
|
||||
{/* Location */}
|
||||
<BentoCard title={t("loanOrders.sections.location", "Lokasiýa")}>
|
||||
<InfoRow label={t("loanOrders.columns.region", "Welaýat")} value={order.region} />
|
||||
<InfoRow label={t("loanOrders.columns.branch", "Şahamça")} value={order.branch} isLink />
|
||||
<InfoRow
|
||||
label={t("loanOrders.columns.branch", "Şahamça")}
|
||||
value={order.branch}
|
||||
isLink
|
||||
href={order.branchId ? `/settings/location/branches/${order.branchId}` : "/settings/location/branches"}
|
||||
/>
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
@@ -175,7 +190,12 @@ export default function LoanOrderViewPage() {
|
||||
<InfoRow label={t("loanOrders.fields.employer", "Kärhananyň ady")} value={order.employer ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.deptPhone", "Işgärler bölüminiň belgisi")} value={order.deptPhone ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.workRegion", "Işleýän welaýaty")} value={order.workRegion ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.workCity", "Işleýän etraby")} value={order.workCity ?? undefined} isLink />
|
||||
<InfoRow
|
||||
label={t("loanOrders.fields.workCity", "Işleýän etraby")}
|
||||
value={order.workCity ?? undefined}
|
||||
isLink
|
||||
href={order.workCityId ? `/settings/location/districts/${order.workCityId}` : "/settings/location/districts"}
|
||||
/>
|
||||
<InfoRow label={t("loanOrders.fields.position", "Wezipe")} value={order.position ?? undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.salary", "Zähmet haky")} value={order.salary ? String(order.salary) : undefined} />
|
||||
<InfoRow label={t("loanOrders.fields.employedSince", "Işe başlan wagty")} value={order.employedSince ?? undefined} />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// pages/OnlinePaymentDetailPage.tsx
|
||||
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Section, InfoRow } from "@/components/viewPageComponents";
|
||||
import { useGetOnlinePaymentById } from "@/features/onlinePaymentHistory/hooks/useOnlinePaymentsHistory";
|
||||
@@ -30,9 +30,7 @@ export default function OnlinePaymentDetailPage() {
|
||||
if (!payment) {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<p className="text-muted-foreground">
|
||||
{t("onlinePayments.notFound", "Töleg tapylmady")}
|
||||
</p>
|
||||
<p className="text-muted-foreground">{t("onlinePayments.notFound", "Töleg tapylmady")}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -43,76 +41,35 @@ export default function OnlinePaymentDetailPage() {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold text-foreground mb-6 break-all">
|
||||
{title}
|
||||
</h1>
|
||||
<h1 className="text-xl font-semibold text-foreground mb-6 break-all">{title}</h1>
|
||||
|
||||
{/* Detail Card */}
|
||||
<Section>
|
||||
<InfoRow label={t("common.id", "ID")} value={payment.id} />
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.amount", "amount")}
|
||||
value={payment.amount}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.orderNumber", "orderNumber")}
|
||||
value={payment.orderNumber}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.apiClient", "Api Client")}
|
||||
value={payment.apiClient}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.description", "description")}
|
||||
value={payment.description}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.orderId", "orderId")}
|
||||
value={payment.orderId}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.formUrl", "formUrl")}
|
||||
isLink
|
||||
value={payment.formUrl}
|
||||
/>
|
||||
<InfoRow label={t("onlinePayments.fields.amount", "amount")} value={payment.amount} />
|
||||
<InfoRow label={t("onlinePayments.fields.orderNumber", "orderNumber")} value={payment.orderNumber} />
|
||||
<InfoRow label={t("onlinePayments.fields.apiClient", "Api Client")} value={payment.apiClient} />
|
||||
<InfoRow label={t("onlinePayments.fields.description", "description")} value={payment.description} />
|
||||
<InfoRow label={t("onlinePayments.fields.orderId", "orderId")} value={payment.orderId} />
|
||||
<InfoRow label={t("onlinePayments.fields.formUrl", "formUrl")} isLink href={payment.formUrl ?? undefined} value={payment.formUrl} />
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.successUrl", "successUrl")}
|
||||
isLink
|
||||
href={payment.successUrl ?? undefined}
|
||||
value={payment.successUrl}
|
||||
/>
|
||||
<InfoRow label={t("onlinePayments.fields.status", "Status")}>
|
||||
<PaymentStatusBadge status={payment.status} />
|
||||
</InfoRow>
|
||||
<InfoRow label={t("onlinePayments.fields.callbackStatus", "callbackStatus")} value={payment.callbackStatus ?? "—"} />
|
||||
<InfoRow label={t("onlinePayments.fields.username", "username")} value={payment.username} />
|
||||
<InfoRow label={t("onlinePayments.fields.onlinePaymantableId", "online_paymantable_id")} value={payment.onlinePaymantableId} />
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.callbackStatus", "callbackStatus")}
|
||||
value={payment.callbackStatus ?? "—"}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.username", "username")}
|
||||
value={payment.username}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t(
|
||||
"onlinePayments.fields.onlinePaymantableId",
|
||||
"online_paymantable_id",
|
||||
)}
|
||||
value={payment.onlinePaymantableId}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t(
|
||||
"onlinePayments.fields.onlinePaymantableType",
|
||||
"online_paymantable_type",
|
||||
)}
|
||||
label={t("onlinePayments.fields.onlinePaymantableType", "online_paymantable_type")}
|
||||
value={payment.onlinePaymantableType}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.createdAt", "Döredilen wagty")}
|
||||
value={formatDateTime(payment.createdAt)}
|
||||
/>
|
||||
<InfoRow
|
||||
label={t("onlinePayments.fields.updatedAt", "Updated at")}
|
||||
value={formatDateTime(payment.updatedAt)}
|
||||
/>
|
||||
<InfoRow label={t("onlinePayments.fields.createdAt", "Döredilen wagty")} value={formatDateTime(payment.createdAt)} />
|
||||
<InfoRow label={t("onlinePayments.fields.updatedAt", "Updated at")} value={formatDateTime(payment.updatedAt)} />
|
||||
</Section>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user