import { useMemo } from "react"; /** * Types for Schema.org structured data */ export interface SchemaOrganization { "@context": "https://schema.org"; "@type": "Organization"; name: string; email?: string; url: string; sameAs?: string[]; } export interface SchemaWebSite { "@context": "https://schema.org"; "@type": "WebSite"; name: string; url: string; potentialAction?: { "@type": "SearchAction"; target: string; "query-input": string; }; } export interface SchemaHowTo { "@context": "https://schema.org"; "@type": "HowTo"; name: string; description: string; step: Array<{ "@type": "HowToStep"; position: number; name: string; text: string; }>; } export interface SchemaArticle { "@context": "https://schema.org"; "@type": "Article"; headline: string; description: string; author: { "@type": "Person"; name: string; }; publisher: { "@type": "Organization"; name: string; url: string; logo?: { "@type": "ImageObject"; url: string; }; }; datePublished: string; dateModified: string; mainEntityOfPage?: { "@type": "WebPage"; "@id": string; }; url: string; articleSection?: string; keywords?: string[]; } export interface SchemaBreadcrumbList { "@context": "https://schema.org"; "@type": "BreadcrumbList"; itemListElement: Array<{ "@type": "ListItem"; position: number; name: string; item: string; }>; } /** * Hook for generating Schema.org structured data (JSON-LD) * Provides type-safe schema generation for SEO and search engines * * @example * ```tsx * const schemaData = useSchemaData({ * type: "HowTo", * name: "How to build a community", * description: "Step-by-step guide", * steps: [ * { name: "Step 1", text: "Start here" }, * { name: "Step 2", text: "Continue here" }, * ], * }); * *