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:
parent
219af5f6f5
commit
8d14fc021c
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
// SOE — Sistema de Operações Empresariais (alias para o módulo Plus/ERP)
|
||||||
|
export { default } from "./Plus";
|
||||||
Loading…
Reference in New Issue