import type { HTMLAttributes, ReactNode } from 'react' export type NoSnippetProps = { /** * Wrapper element. Only div, section and span — Google honours * `data-nosnippet` on those and ignores it on footer, nav, aside and the rest. * Default 'div'. */ as?: 'div' | 'section' | 'span' children?: ReactNode } & HTMLAttributes /** * Keeps its contents out of Google's search snippets (`data-nosnippet`). The * text is still crawled and indexed — Google just won't quote it under a * result. * * Use it for text that repeats on every page: the footer's address, hours and * phone, a contact strip, a "book a visit" call to action. Google picks snippet * text itself when it thinks it fits the query better than the meta * description; for a brand search that is the contact block, so every sitelink * ends up showing the same address. The address stays available to Google * through the LocalBusiness JSON-LD. * * Never wrap
— that's the text the snippet should come from. * *
* …address, hours, phone, links… *
*/ export function NoSnippet({ as: Tag = 'div', children, ...rest }: NoSnippetProps) { return ( {children} ) }