import React from 'react';
import Link from 'next/link';
import { ChevronRight, Home } from 'lucide-react';
interface BreadcrumbItem {
name: string;
url: string;
}
interface BreadcrumbSchemaProps {
items: BreadcrumbItem[];
showUI?: boolean;
}
/**
* Generates JSON-LD BreadcrumbList schema for SEO
* Optionally renders visible breadcrumb navigation
*/
export function BreadcrumbSchema({ items, showUI = false }: BreadcrumbSchemaProps) {
const breadcrumbSchema = {
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: items.map((item, index) => ({
'@type': 'ListItem',
position: index + 1,
name: item.name,
item: item.url,
})),
};
return (
<>
{showUI && (
)}
>
);
}
/**
* Pre-configured breadcrumb for tool pages
* Renders: Home > Free QR Code Tools > [Tool Name]
*/
export function ToolBreadcrumb({ toolName, toolSlug }: { toolName: string; toolSlug: string }) {
const items: BreadcrumbItem[] = [
{ name: 'Home', url: 'https://www.qrmaster.net/' },
{ name: 'Free QR Code Tools', url: 'https://www.qrmaster.net/tools' },
{ name: toolName, url: `https://www.qrmaster.net/tools/${toolSlug}` },
];
return ;
}