mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
feat: add notify by sms .
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import React from 'react';
|
||||
import { DialogContent } from 'components';
|
||||
// import { } from 'hooks/query';
|
||||
import {
|
||||
useEstimateSMSDetail,
|
||||
useCreateNotifyEstimateBySMS,
|
||||
} from 'hooks/query';
|
||||
|
||||
const NotifyEstimateViaSMSContext = React.createContext();
|
||||
|
||||
@@ -9,16 +12,25 @@ function NotifyEstimateViaSMSFormProvider({
|
||||
dialogName,
|
||||
...props
|
||||
}) {
|
||||
const { data: estimateSMSDetail, isLoading: isEstimateSMSDetailLoading } =
|
||||
useEstimateSMSDetail(estimateId, {
|
||||
enabled: !!estimateId,
|
||||
});
|
||||
|
||||
// Create notfiy estimate by sms mutations.
|
||||
const { mutateAsync: createNotifyEstimateBySMSMutate } =
|
||||
useCreateNotifyEstimateBySMS();
|
||||
|
||||
// State provider.
|
||||
const provider = {
|
||||
estimateId,
|
||||
dialogName,
|
||||
estimateSMSDetail,
|
||||
createNotifyEstimateBySMSMutate,
|
||||
};
|
||||
|
||||
return (
|
||||
<DialogContent
|
||||
// isLoading={}
|
||||
>
|
||||
<DialogContent isLoading={isEstimateSMSDetailLoading}>
|
||||
<NotifyEstimateViaSMSContext.Provider value={provider} {...props} />
|
||||
</DialogContent>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user