import { Meta } from '@components/common/Meta.js';
import React from 'react';
export interface OgProps {
type?: 'website' | 'article' | 'product' | string;
/**
* The title of the page to be displayed when shared
*/
title?: string;
/**
* A brief description of the page content
*/
description?: string;
/**
* URL to an image that represents the page
* Recommended size: 1200x630 pixels for best display across platforms
*/
image?: string;
/**
* The canonical URL of the page
*/
url?: string;
/**
* The name of the website or app
*/
siteName?: string;
/**
* For article type, the published date in ISO format
*/
publishedTime?: string;
/**
* For article type, author names or URLs
*/
authors?: string[];
/**
* Locale code for the content (e.g., 'en_US')
*/
locale?: string;
/**
* Alternative locales available for the page
*/
alternateLocales?: string[];
twitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';
twitterSite?: string;
/**
* Twitter @username of the content creator
*/
twitterCreator?: string;
twitterImage?: string;
/**
* Whether to include Twitter card tags
*/
includeTwitterTags?: boolean;
}
export function Og({
type = 'website',
title,
description,
image,
url,
siteName,
publishedTime,
authors,
locale,
alternateLocales,
twitterCard = 'summary',
twitterSite,
twitterCreator,
twitterImage,
includeTwitterTags = true
}: OgProps) {
return (
<>
{title && }
{description && }
{image && }
{url && }
{siteName && }
{type === 'article' && publishedTime && (
)}
{type === 'article' &&
authors?.length &&
authors.map((author, index) => (
))}
{locale && }
{alternateLocales?.length &&
alternateLocales.map((alternateLocale, index) => (
))}
{includeTwitterTags && (
<>
{title && }
{description && (
)}
{twitterSite && }
{twitterCreator && (
)}
{twitterImage && }
>
)}
>
);
}