feat: Implement dynamic OG images

This commit is contained in:
gpt-engineer-app[bot]
2025-10-29 16:49:41 +00:00
parent 320df82329
commit ac63e1d2db
9 changed files with 166 additions and 0 deletions

View File

@@ -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) {