import React, { createContext, PropsWithChildren } from 'react'; import { IFirm } from "../interfaces"; import { useParams } from "react-router"; type FirmContextType = { currentFirm: IFirm, } export const FirmContext = createContext( {} as FirmContextType ); export const FirmContextProvider: React.FC = ({ children }: PropsWithChildren) => { const { instance, firm } = useParams() if (instance === undefined || firm === undefined) { return "Error" } return ( { children } ); }