2021-07-31 15:57:43 +00:00
|
|
|
import { useQuery } from "blitz";
|
2021-07-31 14:33:18 +00:00
|
|
|
|
2021-07-31 15:57:43 +00:00
|
|
|
import getCurrentCustomer from "../../customers/queries/get-current-customer";
|
2021-07-31 14:33:18 +00:00
|
|
|
|
|
|
|
export default function useCurrentCustomer() {
|
2021-07-31 15:57:43 +00:00
|
|
|
const [customer] = useQuery(getCurrentCustomer, null);
|
2021-07-31 14:33:18 +00:00
|
|
|
return {
|
|
|
|
customer,
|
|
|
|
hasCompletedOnboarding: Boolean(!!customer && customer.accountSid && customer.authToken),
|
2021-07-31 15:57:43 +00:00
|
|
|
};
|
2021-07-31 14:33:18 +00:00
|
|
|
}
|