From 8d14fc021ca222ecf682b8de71afd788c28c609b 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 | 25 +++++++++++++++++++++++++ client/src/lib/protected-route.tsx | 2 +- client/src/pages/SOE.tsx | 2 ++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 client/src/contexts/SoeMotorContext.tsx create mode 100644 client/src/pages/SOE.tsx diff --git a/client/src/contexts/SoeMotorContext.tsx b/client/src/contexts/SoeMotorContext.tsx new file mode 100644 index 0000000..52d06f4 --- /dev/null +++ b/client/src/contexts/SoeMotorContext.tsx @@ -0,0 +1,25 @@ +import { createContext, useContext, useState, ReactNode } from "react"; + +interface SoeMotorContextValue { + activeCompany: string | null; + setActiveCompany: (id: string | null) => void; +} + +const SoeMotorContext = createContext({ + activeCompany: null, + setActiveCompany: () => {}, +}); + +export function SoeMotorProvider({ children }: { children: ReactNode }) { + const [activeCompany, setActiveCompany] = useState(null); + + return ( + + {children} + + ); +} + +export function useSoeMotor() { + return useContext(SoeMotorContext); +} 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 new file mode 100644 index 0000000..83a5b4f --- /dev/null +++ b/client/src/pages/SOE.tsx @@ -0,0 +1,2 @@ +// SOE — Sistema de Operações Empresariais (alias para o módulo Plus/ERP) +export { default } from "./Plus";