removed db icon
This commit is contained in:
@@ -99,7 +99,7 @@ export default function OnlinePaymentDetailPage() {
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold text-foreground mb-6">
|
||||
{t("onlinePayments.detail.title", "Onlaýn töleg taryhy giňişleýin")}
|
||||
{orderId ? ` — Order #${orderId}` : ""}
|
||||
{orderId ? ` — Order #${orderId}` : ""} ffffffffffffffffffffffffffff
|
||||
</h1>
|
||||
|
||||
<Section>
|
||||
|
||||
@@ -8,7 +8,6 @@ import { BentoGrid, BentoCard, InfoRow } from "@/components/viewPageComponents";
|
||||
import { GatewayStatusBadge, PaidBadge } from "@/features/onlinePaymentHistory/components/PaymentStatusBadge";
|
||||
import { useGetOnlinePaymentDetail, useGetOnlinePaymentById } from "@/features/onlinePaymentHistory/hooks/useOnlinePaymentsHistory";
|
||||
import { formatFromApiDate } from "@/lib/utils/dateUtils";
|
||||
import type { PaymentHistoryStep } from "@/features/onlinePaymentHistory/api/onlinePaymentsHistoryApi";
|
||||
import { rawEnumKey, type TranslateFn } from "@/constants/enumLabels";
|
||||
|
||||
function formatDateTime(iso: string | null | undefined): string {
|
||||
@@ -26,39 +25,6 @@ function detailKeyLabel(key: string, t: TranslateFn): string {
|
||||
return t(`onlinePayments.detailKeys.${key}`, rawEnumKey(key));
|
||||
}
|
||||
|
||||
function StepTimelineRow({ step }: { step: PaymentHistoryStep }) {
|
||||
const { t } = useTranslation();
|
||||
const detailEntries = Object.entries(step.detail ?? {});
|
||||
|
||||
return (
|
||||
<div className="flex gap-4 relative">
|
||||
<div className="flex flex-col items-center">
|
||||
<div className="w-3 h-3 rounded-full bg-primary mt-1 shrink-0 z-10" />
|
||||
<div className="w-px flex-1 bg-border mt-1" />
|
||||
</div>
|
||||
|
||||
<div className="pb-6 flex-1 min-w-0">
|
||||
<div className="flex flex-wrap items-center gap-3 mb-1">
|
||||
<GatewayStatusBadge status={step.step} />
|
||||
<span className="text-xs text-muted-foreground whitespace-nowrap">{formatDateTime(step.createdAt)}</span>
|
||||
<span className="text-xs text-muted-foreground">{step.createdByName}</span>
|
||||
</div>
|
||||
|
||||
{detailEntries.length > 0 && (
|
||||
<div className="mt-2 rounded-md border bg-muted/30 px-3 py-2 space-y-1">
|
||||
{detailEntries.map(([key, value]) => (
|
||||
<div key={key} className="flex gap-2 text-xs">
|
||||
<span className="text-muted-foreground font-medium min-w-[120px]">{detailKeyLabel(key, t)}</span>
|
||||
<span className="text-foreground break-all">{String(value)}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function OnlinePaymentDetailViewPage() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const navigate = useNavigate();
|
||||
@@ -108,8 +74,8 @@ export default function OnlinePaymentDetailViewPage() {
|
||||
<h1 className="text-xl font-semibold text-foreground tracking-tight">
|
||||
{t("onlinePayments.paymentViewTitle", "Töleg maglumaty")}: #{data.id}
|
||||
</h1>
|
||||
<GatewayStatusBadge status={data.gatewayStatus} />
|
||||
<PaidBadge paid={data.paid} />
|
||||
{/* <GatewayStatusBadge status={data.gatewayStatus} /> */}
|
||||
{/* <PaidBadge paid={data.paid} /> */}
|
||||
</div>
|
||||
{data.orderNumber && (
|
||||
<p className="text-xs text-muted-foreground mt-0.5">
|
||||
@@ -226,16 +192,39 @@ export default function OnlinePaymentDetailViewPage() {
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
{/* ── Row 3: Step-by-Step History Log (Timeline) ───────────────────────── */}
|
||||
{steps && steps.length > 0 && (
|
||||
<BentoCard title={t("onlinePayments.detail.stepsCount", "Ädimler taryhy")}>
|
||||
<div className="p-4">
|
||||
{steps.map((step) => (
|
||||
<StepTimelineRow key={step.id} step={step} />
|
||||
))}
|
||||
</div>
|
||||
</BentoCard>
|
||||
)}
|
||||
{/* ── Row 3: Last Payment Step ──────────────────────────────────────────── */}
|
||||
{steps &&
|
||||
steps.length > 0 &&
|
||||
(() => {
|
||||
const lastStep = [...steps].sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())[0];
|
||||
const detailEntries = Object.entries(lastStep.detail ?? {});
|
||||
|
||||
return (
|
||||
<BentoCard title={t("onlinePayments.lastStep.title", "Iň soňky işlem")}>
|
||||
<div className="p-4 space-y-3">
|
||||
{/* Header: status + time + operator */}
|
||||
<div className="flex flex-wrap items-center gap-3">
|
||||
<GatewayStatusBadge status={lastStep.step} />
|
||||
<span className="text-xs text-muted-foreground whitespace-nowrap">{formatDateTime(lastStep.createdAt)}</span>
|
||||
{lastStep.createdByName && <span className="text-xs text-muted-foreground">{lastStep.createdByName}</span>}
|
||||
<span className="text-xs text-muted-foreground font-mono ml-auto">Step ID: {lastStep.id}</span>
|
||||
</div>
|
||||
|
||||
{/* Detail key-value rows */}
|
||||
{detailEntries.length > 0 && (
|
||||
<div className="rounded-md border bg-muted/30 px-3 py-2 space-y-1">
|
||||
{detailEntries.map(([key, value]) => (
|
||||
<div key={key} className="flex gap-2 text-xs">
|
||||
<span className="text-muted-foreground font-medium min-w-[130px] shrink-0">{detailKeyLabel(key, t)}</span>
|
||||
<span className="text-foreground break-all">{String(value)}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</BentoCard>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user