mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +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 { useCreateNotifyInvoiceBySMS, useInvocieSMSDetails } from 'hooks/query';
|
||||
import {
|
||||
useCreateNotifyPaymentReceiveBySMS,
|
||||
usePaymentReceiveSMSDetail,
|
||||
} from 'hooks/query';
|
||||
|
||||
const NotifyPaymentReceiveViaSMSContext = React.createContext();
|
||||
|
||||
@@ -9,16 +12,27 @@ function NotifyPaymentReceiveViaFormProvider({
|
||||
dialogName,
|
||||
...props
|
||||
}) {
|
||||
// Create notfiy receipt via sms mutations.
|
||||
const { mutateAsync: createNotifyPaymentReceivetBySMSMutate } =
|
||||
useCreateNotifyPaymentReceiveBySMS();
|
||||
|
||||
const {
|
||||
data: paymentReceiveMSDetail,
|
||||
isLoading: isPaymentReceiveSMSDetailLoading,
|
||||
} = usePaymentReceiveSMSDetail(paymentReceiveId, {
|
||||
enabled: !!paymentReceiveId,
|
||||
});
|
||||
|
||||
// State provider.
|
||||
const provider = {
|
||||
paymentReceiveId,
|
||||
dialogName,
|
||||
paymentReceiveMSDetail,
|
||||
createNotifyPaymentReceivetBySMSMutate,
|
||||
};
|
||||
|
||||
return (
|
||||
<DialogContent
|
||||
// isLoading={}
|
||||
>
|
||||
<DialogContent isLoading={isPaymentReceiveSMSDetailLoading}>
|
||||
<NotifyPaymentReceiveViaSMSContext.Provider value={provider} {...props} />
|
||||
</DialogContent>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user