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
This commit is contained in:
Claude 2026-03-17 01:23:46 +00:00
parent 219af5f6f5
commit 8d14fc021c
No known key found for this signature in database
3 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,25 @@
import { createContext, useContext, useState, ReactNode } from "react";
interface SoeMotorContextValue {
activeCompany: string | null;
setActiveCompany: (id: string | null) => void;
}
const SoeMotorContext = createContext<SoeMotorContextValue>({
activeCompany: null,
setActiveCompany: () => {},
});
export function SoeMotorProvider({ children }: { children: ReactNode }) {
const [activeCompany, setActiveCompany] = useState<string | null>(null);
return (
<SoeMotorContext.Provider value={{ activeCompany, setActiveCompany }}>
{children}
</SoeMotorContext.Provider>
);
}
export function useSoeMotor() {
return useContext(SoeMotorContext);
}

View File

@ -7,7 +7,7 @@ export function ProtectedRoute({
component: Component, component: Component,
}: { }: {
path: string; path: string;
component: () => React.JSX.Element; component: React.ComponentType<any>;
}) { }) {
const { user, isLoading } = useAuth(); const { user, isLoading } = useAuth();

2
client/src/pages/SOE.tsx Normal file
View File

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