From 5d1dd97d0f811d8d65b8d91b50a8e5e8884e044c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Mar 2026 01:23:46 +0000 Subject: [PATCH] fix: resolve missing modules and type errors in App.tsx - Create client/src/contexts/SoeMotorContext.tsx with SoeMotorProvider - Create client/src/pages/SOE.tsx (re-export of Plus/ERP module) - Fix ProtectedRoute component type to accept LazyExoticComponent Resolves TS2307 for @/contexts/SoeMotorContext and @/pages/SOE, and TS2322 for all lazy-loaded routes. https://claude.ai/code/session_01DinH3VcgbAv1d9MqnNxzdb --- client/src/contexts/SoeMotorContext.tsx | 16 ++++++++++++---- client/src/lib/protected-route.tsx | 2 +- client/src/pages/SOE.tsx | 9 ++------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/client/src/contexts/SoeMotorContext.tsx b/client/src/contexts/SoeMotorContext.tsx index 996a6ce..52d06f4 100644 --- a/client/src/contexts/SoeMotorContext.tsx +++ b/client/src/contexts/SoeMotorContext.tsx @@ -1,12 +1,20 @@ -import { createContext, useContext, ReactNode } from "react"; +import { createContext, useContext, useState, ReactNode } from "react"; -interface SoeMotorContextType {} +interface SoeMotorContextValue { + activeCompany: string | null; + setActiveCompany: (id: string | null) => void; +} -const SoeMotorContext = createContext({}); +const SoeMotorContext = createContext({ + activeCompany: null, + setActiveCompany: () => {}, +}); export function SoeMotorProvider({ children }: { children: ReactNode }) { + const [activeCompany, setActiveCompany] = useState(null); + return ( - + {children} ); diff --git a/client/src/lib/protected-route.tsx b/client/src/lib/protected-route.tsx index 1bc483f..3e91a82 100644 --- a/client/src/lib/protected-route.tsx +++ b/client/src/lib/protected-route.tsx @@ -7,7 +7,7 @@ export function ProtectedRoute({ component: Component, }: { path: string; - component: () => React.JSX.Element; + component: React.ComponentType; }) { const { user, isLoading } = useAuth(); diff --git a/client/src/pages/SOE.tsx b/client/src/pages/SOE.tsx index ca173a7..83a5b4f 100644 --- a/client/src/pages/SOE.tsx +++ b/client/src/pages/SOE.tsx @@ -1,7 +1,2 @@ -export default function SOE() { - return ( -
-

SOE — em desenvolvimento

-
- ); -} +// SOE — Sistema de Operações Empresariais (alias para o módulo Plus/ERP) +export { default } from "./Plus";