Add frontend/modules/loyalty with types, API client, design system, feature pages and thin App Router routes under app/loyalty/. BFF proxy at app/api/loyalty/. Include loyalty frontend docs. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
"use client";
|
|
|
|
import { PageHeader, Card, CardContent, Badge } from "@/components/ds";
|
|
import { LoyaltyBreadcrumbs } from "@/modules/loyalty/components/LoyaltyBreadcrumbs";
|
|
import { LoyaltyPageLoader, LoyaltyPageError, useLoyaltyHealth } from "@/modules/loyalty/pages/shared";
|
|
|
|
export default function HealthPage() {
|
|
const q = useLoyaltyHealth();
|
|
if (q.isLoading) return <LoyaltyPageLoader />;
|
|
if (q.error) return <LoyaltyPageError error={q.error} onRetry={() => q.refetch()} />;
|
|
const h = q.data!;
|
|
return (
|
|
<div>
|
|
<LoyaltyBreadcrumbs items={[{ label: "سلامت سرویس" }]} />
|
|
<PageHeader title="سلامت سرویس" description="GET /health از سرویس Loyalty." />
|
|
<Card>
|
|
<CardContent className="flex flex-wrap items-center gap-4 pt-6">
|
|
<Badge tone={h.status === "ok" ? "success" : "danger"}>{h.status}</Badge>
|
|
<span>{h.service}</span>
|
|
<span className="text-[var(--muted)]">v{h.version}</span>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|