mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
feat: getting subscription endpoint
This commit is contained in:
@@ -1,3 +1,28 @@
|
||||
export function BillingPageBoot() {
|
||||
return null;
|
||||
import React, { createContext } from 'react';
|
||||
import { useGetSubscriptions } from '@/hooks/query/subscription';
|
||||
|
||||
interface BillingBootContextValues {
|
||||
isSubscriptionsLoading: boolean;
|
||||
subscriptions: any;
|
||||
}
|
||||
|
||||
const BillingBoot = createContext<BillingBootContextValues>(
|
||||
{} as BillingBootContextValues,
|
||||
);
|
||||
|
||||
interface BillingPageBootProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export function BillingPageBoot({ children }: BillingPageBootProps) {
|
||||
const { isLoading: isSubscriptionsLoading, data: subscriptions } =
|
||||
useGetSubscriptions();
|
||||
|
||||
const value = {
|
||||
isSubscriptionsLoading,
|
||||
subscriptions,
|
||||
};
|
||||
return <BillingBoot.Provider value={value}>{children}</BillingBoot.Provider>;
|
||||
}
|
||||
|
||||
export const useBillingPageBoot = () => React.useContext(BillingBoot);
|
||||
|
||||
Reference in New Issue
Block a user