Skip to content

Instantly share code, notes, and snippets.

@MaikelVeen
Created January 20, 2021 22:54
Show Gist options
  • Save MaikelVeen/9ff042fbfc040c18b067e702e4964b62 to your computer and use it in GitHub Desktop.
Save MaikelVeen/9ff042fbfc040c18b067e702e4964b62 to your computer and use it in GitHub Desktop.
function BreadcrumbItem({ url, name, index, isLast }:
{ url: string, name: string, index: number, isLast: boolean }) {
return (
<React.Fragment>
<li itemProp="itemListElement" itemScope
itemType="https://schema.org/ListItem" key={index} className="breadcrumb-element">
<a itemProp="item" href={url} className="breadcrumb-element__link">
<span itemProp="name" className="breadcrumb-element__name">{name}</span></a>
<meta itemProp="position" content={index.toString()} />
</li>
{isLast ? "" : <span className="breadcrumb-element__divider">{'>'}</span>}
</React.Fragment>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment