TorbatYar/frontend/modules/loyalty/features/dashboards/executive.tsx
Mortezakoohjani d579d0b142 feat(loyalty): add Loyalty Platform Frontend module
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>
2026-07-27 10:50:55 +03:30

34 lines
1.1 KiB
TypeScript
Raw Permalink 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 { PageHeader } from "@/components/ds";
import { useTenantId } from "@/hooks/useTenantId";
import { LoyaltyBreadcrumbs } from "@/modules/loyalty/components/LoyaltyBreadcrumbs";
import {
LoyaltyCountsGrid,
LoyaltyPageLoader,
LoyaltyServiceBadge,
useLoyaltyHealth,
} from "@/modules/loyalty/pages/shared";
export default function ExecutiveDashboard() {
const { tenantId } = useTenantId();
const health = useLoyaltyHealth();
if (!tenantId) return <LoyaltyPageLoader />;
return (
<div className="space-y-6">
<LoyaltyBreadcrumbs items={[{ label: "داشبورد مدیریتی" }]} />
<PageHeader
title="داشبورد مدیریتی"
description="نمای اجرایی پلتفرم وفاداری — آمار واقعی از API."
actions={<LoyaltyServiceBadge />}
/>
<LoyaltyCountsGrid tenantId={tenantId} />
{health.data ? (
<p className="text-xs text-[var(--muted)]">
سرویس {health.data.service} نسخه {health.data.version} وضعیت {health.data.status}
</p>
) : null}
</div>
);
}