Ship the delivery platform UI under modules/delivery with thin app routes, BFF proxy, CRUD for phase 10.0-10.1 APIs, and capability-gated future screens. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
1.3 KiB
TypeScript
29 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import { useDeliveryCapabilities } from "@/modules/delivery/hooks/useDeliveryCapabilities";
|
|
import { DeliveryPageLoader, DeliveryPageError } from "@/modules/delivery/pages/shared";
|
|
import { PageHeader, Card, CardContent, Badge } from "@/components/ds";
|
|
import { DeliveryBreadcrumbs } from "@/modules/delivery/components/DeliveryBreadcrumbs";
|
|
|
|
export const CapabilitiesPage = function DeliveryCapabilitiesPage() {
|
|
const q = useDeliveryCapabilities();
|
|
if (q.isLoading) return <DeliveryPageLoader />;
|
|
if (q.error) return <DeliveryPageError error={q.error} onRetry={() => q.refetch()} />;
|
|
const features = q.data?.features ?? {};
|
|
return (
|
|
<div>
|
|
<DeliveryBreadcrumbs current="قابلیتها" />
|
|
<PageHeader title="قابلیتها" description={`فاز ${q.data?.phase} — ${q.data?.commercial_product}`} />
|
|
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
|
{Object.entries(features).map(([k, v]) => (
|
|
<Card key={k}><CardContent className="flex items-center justify-between p-3">
|
|
<span className="text-sm font-mono">{k}</span>
|
|
<Badge tone={v ? "success" : "default"}>{v ? "فعال" : "غیرفعال"}</Badge>
|
|
</CardContent></Card>
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
export default CapabilitiesPage;
|