TorbatYar/frontend/modules/crm/components/CrmScopeNotice.tsx
Mortezakoohjani e140908034 Ship enterprise CRM frontend with real API wiring and thin app routes.
Connect all CRM pages to the BFF and CRM service, add module docs, and mark CRM available in the SuperApp catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 20:58:17 +03:30

47 lines
1.4 KiB
TypeScript

"use client";
import { Card, CardContent, EmptyState } from "@/components/ds";
import { AlertTriangle } from "lucide-react";
export function CrmScopeNotice({
title,
description,
alternatives,
}: {
title: string;
description: string;
alternatives?: { label: string; href: string }[];
}) {
return (
<Card className="border-amber-200 bg-amber-50/50 dark:border-amber-900 dark:bg-amber-950/20">
<CardContent className="flex gap-4 pt-6">
<AlertTriangle className="h-6 w-6 shrink-0 text-amber-600" />
<div>
<h2 className="font-semibold text-secondary">{title}</h2>
<p className="mt-2 text-sm text-[var(--muted)]">{description}</p>
{alternatives?.length ? (
<ul className="mt-4 space-y-2 text-sm">
{alternatives.map((a) => (
<li key={a.href}>
<a href={a.href} className="text-[var(--crm-accent)] hover:underline">
{a.label}
</a>
</li>
))}
</ul>
) : null}
</div>
</CardContent>
</Card>
);
}
export function CrmPermissionDenied({ message }: { message?: string }) {
return (
<EmptyState
title="دسترسی محدود"
description={message ?? "شما مجوز مشاهده این بخش را ندارید. با مدیر tenant تماس بگیرید."}
/>
);
}