"use client"; import React, { useEffect, useState } from 'react' import './privacy.css' const PrivacyPolicy = () => { const [htmlContent, setHtmlContent] = useState(""); const [loading,setLoading] = useState(false) const fetchdata = async () => { setLoading(true); try { const response = await fetch("/api/privacy-policy", { method: "GET", }); const resData = await response.json(); setHtmlContent(resData.data); } catch (error) { console.error("Error fetching data:", error); } finally { setLoading(false); } }; useEffect(() => { fetchdata(); }, []); return (
{loading ? (
Loading content, please wait...
) : htmlContent ? (
) : (
No content available
)}
) } export default PrivacyPolicy