hooks/useCustomerStatus
Hook
useCustomerStatus()
useCustomerStatus(
params
):AsyncQueryState
\<null
|"Active"
|"Rejected"
|"Dormant"
|"To be reviewed"
|"Failed"
|"Escalated"
|"Terminated"
|"No status"
>
A hook that returns the current customer status.
Parameters
• params: UseCustomerStatusParams
= ...
Returns
AsyncQueryState
\<null
| "Active"
| "Rejected"
| "Dormant"
| "To be reviewed"
| "Failed"
| "Escalated"
| "Terminated"
| "No status"
>
The async query state of the customer status.
Example
import { useCustomerStatus } from "@compilot/react-sdk";
const MyComponent = () => {
const { data: status } = useCustomerStatus();
const isVerified = status === "Active";
return <div>User is verified: {isVerified}</div>;
};
Output:
<div>User is verified: true</div>
Parameter Types
UseCustomerStatusParams
UseCustomerStatusParams: {
refreshInterval
:number
; }
The parameters of the useCustomerStatus hook.
Type declaration
refreshInterval
refreshInterval:
number
The interval in milliseconds to refresh the customer status.
Default
10000