mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat(branche & warehouse activate) add api.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import React from 'react';
|
||||
|
||||
import { DialogContent } from 'components';
|
||||
import { useActivateWarehouses } from 'hooks/query';
|
||||
|
||||
const WarehouseActivateContext = React.createContext();
|
||||
|
||||
/**
|
||||
* warehouse activate form provider.
|
||||
*/
|
||||
function WarehouseActivateFormProvider({ dialogName, ...props }) {
|
||||
const { mutateAsync: activateWarehouses, isLoading } =
|
||||
useActivateWarehouses();
|
||||
|
||||
// State provider.
|
||||
const provider = {
|
||||
activateWarehouses,
|
||||
dialogName,
|
||||
};
|
||||
|
||||
return (
|
||||
<DialogContent isLoading={isLoading}>
|
||||
<WarehouseActivateContext.Provider value={provider} {...props} />
|
||||
</DialogContent>
|
||||
);
|
||||
}
|
||||
|
||||
const useWarehouseActivateContext = () =>
|
||||
React.useContext(WarehouseActivateContext);
|
||||
|
||||
export { WarehouseActivateFormProvider, useWarehouseActivateContext };
|
||||
Reference in New Issue
Block a user