TorbatYar/frontend/modules/communication/features/capabilities.tsx
Mortezakoohjani 10c3c43a75 feat(communication): add SMS MVP frontend with governance artifacts.
Ship the full Communication portal (real SMS API, feature-locked future channels), BFF proxy, docs, snapshot, and phase handover.

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

47 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 { useCommunicationCapabilities } from "@/modules/communication/hooks/useCommunicationCapabilities";
import { CommunicationPageLoader, CommunicationPageError } from "@/modules/communication/pages/shared";
import { PageHeader, Card, CardContent, Badge } from "@/components/ds";
import { CommunicationBreadcrumbs } from "@/modules/communication/components/CommunicationBreadcrumbs";
export function CapabilitiesPage() {
const q = useCommunicationCapabilities();
if (q.isLoading) return <CommunicationPageLoader />;
if (q.error) return <CommunicationPageError error={q.error} onRetry={() => q.refetch()} />;
const features = q.data?.features ?? {};
const channels = q.data?.channels ?? [];
return (
<div className="space-y-6">
<CommunicationBreadcrumbs current="قابلیت‌ها" />
<PageHeader title="قابلیت‌ها" description={`${q.data?.commercial_product} — فاز ${q.data?.phase}`} />
<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="font-mono text-sm">{k}</span>
<Badge tone={v ? "success" : "default"}>{v ? "فعال" : "غیرفعال"}</Badge>
</CardContent>
</Card>
))}
</div>
<Card>
<CardContent className="p-4">
<p className="mb-2 text-sm font-semibold">کانالها</p>
<div className="flex flex-wrap gap-2">
{channels.map((c) => (
<Badge key={c.channel} tone={c.status === "active" ? "success" : "warning"}>
{c.channel}: {c.status}
</Badge>
))}
</div>
</CardContent>
</Card>
</div>
);
}
export default CapabilitiesPage;