import React from 'react'; import { Link } from 'react-router'; import { LockClosedIcon } from '@heroicons/react/24/outline'; import { useSubscription } from '../../hooks/useSubscription'; interface FeatureGateProps { feature: string; children: React.ReactNode; } export default function FeatureGate({ feature, children }: FeatureGateProps) { const { hasFeature, hasPlan } = useSubscription(); if (hasFeature(feature)) return <>{children}; return (
این قابلیت در پنل فعلی شما فعال نیست
{hasPlan ? 'برای استفاده از این قابلیت پنل خود را ارتقاء دهید' : 'برای استفاده از این قابلیت یک پنل اشتراکی فعال کنید'}
{hasPlan ? 'ارتقاء پنل' : 'مشاهده پنل‌های اشتراکی'}
); }