"use client";
import { useSearchParams } from 'next/navigation';
import Header from "@/components/shared/layout/header/Header";
import Footer from "@/components/shared/layout/footer/Footer";
import { Suspense } from 'react';
import { usePolicy } from '@/lib/hooks/usePolicy';
const PolicyContent = () => {
const searchParams = useSearchParams();
const typeParam = searchParams.get('type') || 'privacy';
const type = typeParam as 'privacy' | 'terms' | 'support';
const { data: policy, isLoading, error } = usePolicy(type);
if (isLoading) {
return (
Loading policy... {error?.message || 'The requested policy could not be found.'}
Last Updated: {new Date(policy.last_updated).toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
})}
Version {policy.version}
Effective Date: {new Date(policy.effective_date).toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
})}
{policy.description} If you have any questions about this policy, please don't hesitate to contact us.Unable to Load Policy
{policy.title}
{section.heading}
(a)')
.replace(/\(b\)/g, '
(b)')
.replace(/\(c\)/g, '
(c)')
.replace(/\(d\)/g, '
(d)')
.replace(/\(e\)/g, '
(e)')
.replace(/\(f\)/g, '
(f)')
.replace(/\(g\)/g, '
(g)')
.replace(/\(h\)/g, '
(h)')
.replace(/\(i\)/g, '
(i)')
.replace(/\(j\)/g, '
(j)')
.replace(/\(k\)/g, '
(k)')
.replace(/\(l\)/g, '
(l)')
// Handle pipe separators for contact information
.replace(/ \| /g, '
')
.replace(/: /g, ': ')
// Handle semicolon with parenthesis
.replace(/; \(/g, ';
(')
// Add spacing after periods in long sentences
.replace(/\. ([A-Z])/g, '.
$1')
}} />
Questions?