59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
import { Box, HStack, Text, Skeleton, VStack, Center } from "@chakra-ui/react";
|
|
import MainFrame from "../../../components/MainFrame";
|
|
import PrivacyPolicyAddModel from "./PrivacyPolicyAddModel";
|
|
import { useGetPrivacyPolicyQuery } from "../../../Redux/Service/privacy.policy.service";
|
|
import PrivacyPolicySkeleton from "./privacyPolicySkeleton";
|
|
import { Spinner } from "../../../components/Sipnner/Spinner";
|
|
|
|
|
|
const PrivacyPolicy = () => {
|
|
// Fetch data using RTK Query with type annotations
|
|
const { data, isLoading, isFetching } = useGetPrivacyPolicyQuery();
|
|
|
|
console.log(isLoading);
|
|
|
|
|
|
// Log the response for debugging
|
|
console.log("====================================");
|
|
console.log(data);
|
|
console.log("====================================");
|
|
|
|
|
|
return (
|
|
<MainFrame transperant={true}>
|
|
<VStack gap={4} pb={4} pt={0}>
|
|
{isLoading?
|
|
<Spinner/>:data?.data?.map(({id,content}, index)=><VStack bg={'#fff'}
|
|
boxShadow={'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px'} rounded={'lg'} p={3} key={id}>
|
|
<HStack
|
|
w={"100%"}
|
|
justifyContent={"space-between"}
|
|
|
|
py={0}
|
|
px={0}
|
|
>
|
|
<Text as={"span"} fontSize={"sm"} fontWeight={500} color={"#000"}>
|
|
Privacy Policy
|
|
</Text>
|
|
|
|
<PrivacyPolicyAddModel />
|
|
</HStack>
|
|
|
|
{/* Render multiple skeletons or content based on loading state */}
|
|
|
|
<Text
|
|
as="p"
|
|
fontSize="sm"
|
|
fontWeight={400}
|
|
color="#1D1D1D"
|
|
>
|
|
{content}
|
|
</Text>
|
|
|
|
</VStack>)}
|
|
</VStack>
|
|
</MainFrame>
|
|
);
|
|
};
|
|
|
|
export default PrivacyPolicy; |