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

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

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