updates
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
"use client";
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
import { useEffect } from 'react';
|
||||
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';
|
||||
import { generateMetadata as createMetadata } from "@/lib/seo/metadata";
|
||||
|
||||
const PolicyContent = () => {
|
||||
const searchParams = useSearchParams();
|
||||
@@ -12,6 +14,44 @@ const PolicyContent = () => {
|
||||
|
||||
const { data: policy, isLoading, error } = usePolicy(type);
|
||||
|
||||
// Update metadata based on policy type
|
||||
useEffect(() => {
|
||||
const policyTitles = {
|
||||
privacy: 'Privacy Policy - Data Protection & Privacy',
|
||||
terms: 'Terms of Use - Terms & Conditions',
|
||||
support: 'Support Policy - Support Terms & Guidelines',
|
||||
};
|
||||
|
||||
const policyDescriptions = {
|
||||
privacy: 'Read GNX Soft\'s Privacy Policy to understand how we collect, use, and protect your personal information and data.',
|
||||
terms: 'Review GNX Soft\'s Terms of Use and Conditions for using our software services and platforms.',
|
||||
support: 'Learn about GNX Soft\'s Support Policy, including support terms, response times, and service level agreements.',
|
||||
};
|
||||
|
||||
const metadata = createMetadata({
|
||||
title: policyTitles[type],
|
||||
description: policyDescriptions[type],
|
||||
keywords: [
|
||||
type === 'privacy' ? 'Privacy Policy' : type === 'terms' ? 'Terms of Use' : 'Support Policy',
|
||||
'Legal Documents',
|
||||
'Company Policies',
|
||||
'Data Protection',
|
||||
'Terms and Conditions',
|
||||
],
|
||||
url: `/policy?type=${type}`,
|
||||
});
|
||||
|
||||
document.title = metadata.title || `${policyTitles[type]} | GNX Soft`;
|
||||
|
||||
let metaDescription = document.querySelector('meta[name="description"]');
|
||||
if (!metaDescription) {
|
||||
metaDescription = document.createElement('meta');
|
||||
metaDescription.setAttribute('name', 'description');
|
||||
document.head.appendChild(metaDescription);
|
||||
}
|
||||
metaDescription.setAttribute('content', metadata.description || policyDescriptions[type]);
|
||||
}, [type]);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<section className="policy-section section-padding">
|
||||
|
||||
Reference in New Issue
Block a user