TorbatYar/frontend/modules/payment/features/hub.tsx
Mortezakoohjani 4451b32a33 feat(payment-frontend): ship Torbat Pay admin portal for MVP 14.0-14.5
Add payment module, BFF proxy, hub/dashboard/ops/PSP/merchant screens wired to real APIs, and mark payment-frontend complete in project status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 18:35:07 +03:30

37 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
import Link from "next/link";
import { useMe } from "@/hooks/useMe";
import { PAYMENT_PORTAL } from "@/modules/payment/constants/portals";
import { Card, CardContent, Button, LoadingState, ErrorState } from "@/components/ds";
export const PaymentHub = function PaymentHubPage() {
const { me, loading, error, reload } = useMe();
if (loading) return <LoadingState label="در حال بارگذاری تربت‌پی…" />;
if (error) return <ErrorState message={error} onRetry={reload} />;
if (!me?.current_tenant_id) {
return <ErrorState message="برای استفاده از تربت‌پی workspace فعال لازم است." />;
}
return (
<div className="mx-auto flex min-h-[70vh] max-w-lg flex-col items-center justify-center gap-6 p-6 text-center">
<div className="text-5xl">💳</div>
<div>
<h1 className="text-2xl font-bold text-secondary">{PAYMENT_PORTAL.label}</h1>
<p className="mt-2 text-sm text-[var(--muted)]">{PAYMENT_PORTAL.description}</p>
</div>
<Card className="w-full">
<CardContent className="space-y-3 p-6">
<p className="font-medium">{PAYMENT_PORTAL.label}</p>
<p className="text-sm text-[var(--muted)]">{PAYMENT_PORTAL.description}</p>
<Link href="/payment/dashboard">
<Button className="w-full">ورود به پنل پرداخت</Button>
</Link>
</CardContent>
</Card>
</div>
);
};
export default PaymentHub;