File "useSiteProfile.js"
Full Path: /home/fresvfqn/waterdamagerestorationandrepairsmithtown.com/wp-content/plugins/extendify/src/Launch/hooks/useSiteProfile.js
File size: 533 bytes
MIME-type: text/x-java
Charset: utf-8
import useSWRImmutable from 'swr/immutable';
import { getSiteProfile } from '@launch/api/DataApi';
import { useUserSelectionStore } from '@launch/state/user-selections';
export const useSiteProfile = () => {
const { siteInformation, businessInformation } = useUserSelectionStore();
const { data, error } = useSWRImmutable(
{
key: 'site-profile',
title: siteInformation?.title,
description: businessInformation?.description,
},
getSiteProfile,
);
return { siteProfile: data, error, loading: !data && !error };
};