diff --git a/src/App.tsx b/src/App.tsx index 1838985..7f16f71 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -306,7 +306,7 @@ export default function App() {

- {isSecretAdminRoute ? <>FXBROS ADMIN : <>QUANTSCAN} + {isSecretAdminRoute ? <>FXBROS ADMIN : <>QUANTSCAN}

{isSecretAdminRoute ? "Acesso Restrito" : "Acesse a inteligência institucional Pro."} @@ -626,7 +626,7 @@ export default function App() { />

Olá Humano, Bem-Vindo -
QUANTSCAN
+
QUANTSCAN
+ )} + {user.isAdmin && ( diff --git a/src/components/AnalysisView.tsx b/src/components/AnalysisView.tsx index 7be77e3..f050886 100644 --- a/src/components/AnalysisView.tsx +++ b/src/components/AnalysisView.tsx @@ -18,6 +18,13 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void const [mode, setMode] = useState<'Técnico' | 'Fundamental' | 'Híbrido'>('Híbrido'); const [usageInfo, setUsageInfo] = useState<{ used: number, limit: number }>({ used: 0, limit: userData?.analysisLimit ?? 8 }); + const now = Date.now(); + const isLifetime = userData?.plan === 'lifetime'; + const endsAt = userData?.subscriptionEndsAt; + const isExpired = !!(!isLifetime && endsAt && now > endsAt); + const daysRemaining = !isLifetime && endsAt ? (endsAt - now) / (1000 * 60 * 60 * 24) : null; + const isEndingSoon = daysRemaining !== null && Math.ceil(daysRemaining) <= 3 && Math.ceil(daysRemaining) > 0; + useEffect(() => { const fetchUsage = async () => { if (!auth.currentUser) return; @@ -54,6 +61,10 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void }, [result, userData]); const handleStartAnalysis = async () => { + if (isExpired) { + setError("Sua assinatura expirou. Por favor, contate o administrador para renovar o plano."); + return; + } if (!preview || !file) return; if (usageInfo.used >= usageInfo.limit) { setError(`Limite diário atingido (${usageInfo.used}/${usageInfo.limit}). Faça upgrade para análises ilimitadas.`); @@ -129,6 +140,30 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void return (
+ {isExpired && ( +
+ +
+

Assinatura Expirada

+

+ Sua assinatura expirou. Renove seu plano para continuar usando o scanner analisador. +

+
+
+ )} + + {isEndingSoon && ( +
+ +
+

Assinatura Expirando

+

+ Sua assinatura expira em {Math.ceil(daysRemaining)} dia(s). Renove agora para não perder o acesso ao scanner. +

+
+
+ )} +

@@ -193,10 +228,11 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void {...getRootProps()} className={cn( "w-full flex flex-col items-center justify-center py-10 rounded-xl cursor-pointer transition-all duration-300 border border-transparent", - isDragActive ? "bg-brand-red/5 scale-[0.98] border-brand-red/30" : "hover:bg-zinc-800/20" + isDragActive ? "bg-brand-red/5 scale-[0.98] border-brand-red/30" : "hover:bg-zinc-800/20", + isExpired ? "opacity-50 pointer-events-none" : "" )} > - +
@@ -205,10 +241,13 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void
-
@@ -334,7 +334,7 @@ export const LandingPage: React.FC = ({ onGetStarted, onViewPl

- QUANTSCAN + QUANTSCAN

diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 48fbab6..58f640a 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -37,7 +37,7 @@ export const Navbar: React.FC = ({ activeTab, setActiveTab, isAdmin />

- QUANTSCAN + QUANTSCAN IA TRADER
diff --git a/src/components/PlansView.tsx b/src/components/PlansView.tsx index de89329..72d98ac 100644 --- a/src/components/PlansView.tsx +++ b/src/components/PlansView.tsx @@ -237,7 +237,7 @@ export const PlansView: React.FC = ({ isUnauthenticated, onGetSt
= ({ isUnauthenticated, onGetSt /> = ({ isUnauthenticated, onGetSt /> = ({ isUnauthenticated, onGetSt />