import { createContext, PropsWithChildren } from "react";
import { AccountDashboardApi } from "../types/account-dashboard-types";

export const AccountDashboardApiContext = createContext<AccountDashboardApi>(
	{} as AccountDashboardApi
);

export function WithKiroAccountApiContext({
	children,
	api,
}: PropsWithChildren<{ api: AccountDashboardApi }>): React.JSX.Element {
	return (
		<AccountDashboardApiContext.Provider value={api}>
			{children}
		</AccountDashboardApiContext.Provider>
	);
}
