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 committed by root
parent 07fa5e5871
commit 5d1dd97d0f
3 changed files with 15 additions and 12 deletions

View File

@ -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<SoeMotorContextType>({});
const SoeMotorContext = createContext<SoeMotorContextValue>({
activeCompany: null,
setActiveCompany: () => {},
});
export function SoeMotorProvider({ children }: { children: ReactNode }) {
const [activeCompany, setActiveCompany] = useState<string | null>(null);
return (
<SoeMotorContext.Provider value={{}}>
<SoeMotorContext.Provider value={{ activeCompany, setActiveCompany }}>
{children}
</SoeMotorContext.Provider>
);

View File

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

View File

@ -1,7 +1,2 @@
export default function SOE() {
return (
<div className="flex items-center justify-center h-full">
<p className="text-muted-foreground">SOE em desenvolvimento</p>
</div>
);
}
// SOE — Sistema de Operações Empresariais (alias para o módulo Plus/ERP)
export { default } from "./Plus";