"use client"; import Link from "next/link"; import { Lock, Rocket, Sparkles } from "lucide-react"; import { Button, Card, CardContent, Badge } from "@/components/ds"; import { CommunicationBreadcrumbs } from "@/modules/communication/components/CommunicationBreadcrumbs"; import { useCommunicationCapabilities, isFeatureEnabled, } from "@/modules/communication/hooks/useCommunicationCapabilities"; import { CommunicationPageLoader, CommunicationPageError } from "@/modules/communication/pages/shared"; import { FeatureLock } from "@/modules/commercial/components"; import { useTenantId } from "@/hooks/useTenantId"; import type { FeatureLockConfig } from "@/modules/communication/types"; /** * L2 capability gate + Commercial Runtime entitlement. * UI copy only (title/description/phase) — no commercial catalogs. */ export function CommunicationFeatureLock({ config, children, }: { config: FeatureLockConfig; children?: React.ReactNode; }) { const caps = useCommunicationCapabilities(); const { tenantId } = useTenantId(); if (caps.isLoading) return ; if (caps.error) return caps.refetch()} />; const enabled = isFeatureEnabled(caps.data?.features, config.feature); if (enabled && children) { if (!tenantId) return <>{children}; const commercialKey = config.feature.startsWith("communication.") ? config.feature : `communication.${config.feature}`; return ( {children} ); } return (
به‌زودی

{config.title}

{config.description}

{config.phase ? (

فاز برنامه‌ریزی: {config.phase}

) : null}
entitlement و قابلیت‌ها فقط از Commercial Runtime / L2 capabilities.

باز شدن: وقتی{" "} /capabilities ویژگی{" "} {config.feature} را فعال کند و Commercial Runtime مجوز دهد.

); } export function createCommunicationLockedPage(config: FeatureLockConfig) { return function CommunicationLockedPage() { return ; }; } export function createCommunicationFeatureGate(config: FeatureLockConfig, Page: React.ComponentType) { return function CommunicationGatedPage() { return ( ); }; }