import { PropsWithChildren, createContext } from "react";
import { IDataSource } from "./DataSource";

export const DataSourceContext = createContext<IDataSource | null>(null);

export const DataSourceProvider = ({
  dataSource,
  children,
}: PropsWithChildren<{
  dataSource: IDataSource;
}>) => <DataSourceContext.Provider value={dataSource}>{children}</DataSourceContext.Provider>;
