import { type PropsWithChildren, createContext } from "react";
import { type 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>;
