mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 00:11:14 -05:00
feat: Implement dynamic OG images
This commit is contained in:
@@ -26,6 +26,7 @@ import { VersionIndicator } from '@/components/versioning/VersionIndicator';
|
||||
import { EntityHistoryTabs } from '@/components/history/EntityHistoryTabs';
|
||||
import { useAuthModal } from '@/hooks/useAuthModal';
|
||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||
|
||||
export default function OperatorDetail() {
|
||||
const { slug } = useParams<{ slug: string }>();
|
||||
@@ -45,6 +46,16 @@ export default function OperatorDetail() {
|
||||
|
||||
// Update document title when operator changes
|
||||
useDocumentTitle(operator?.name || 'Operator Details');
|
||||
|
||||
// Update Open Graph meta tags
|
||||
useOpenGraph({
|
||||
title: operator?.name || '',
|
||||
description: operator?.description || (operator ? `${operator.name} - Park Operator${operator.headquarters_location ? ` based in ${operator.headquarters_location}` : ''}` : ''),
|
||||
imageUrl: operator?.banner_image_url,
|
||||
imageId: operator?.banner_image_id,
|
||||
type: 'profile',
|
||||
enabled: !!operator
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (slug) {
|
||||
|
||||
Reference in New Issue
Block a user