import LegalPages from 'Layout/LegalPages';
import { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import {
fetchTermsAndConditions,
selectTermsAndConditions,
selectTermsAndConditionsIsLoading,
} from 'store/slices/LegalSlice';
const TermsAndConditions = () => {
const dispatch = useDispatch();
const isLoading = useSelector(selectTermsAndConditionsIsLoading);
const data = useSelector(selectTermsAndConditions);
useEffect(() => {
// @ts-ignore
dispatch(fetchTermsAndConditions());
}, [dispatch]);
const { blocks, title, updatedAt } = data;
return <LegalPages loading={isLoading} title={title} blocks={blocks} updatedAt={updatedAt} />;
};
export default TermsAndConditions;