diff --git a/explorer-nextjs/src/components/blogs/TableOfContents.tsx b/explorer-nextjs/src/components/blogs/TableOfContents.tsx new file mode 100644 index 0000000000..cc95cc9c3c --- /dev/null +++ b/explorer-nextjs/src/components/blogs/TableOfContents.tsx @@ -0,0 +1,37 @@ +import { Card, CardContent, CardHeader, Typography } from "@mui/material"; +import { Link } from "../muiLink"; + +const TableOfContents = ({ + headings, +}: { + headings: { id: string; heading: string }[]; +}) => { + return ( + + + + {headings.map((heading) => ( + + + {heading.heading} + + + ))} + + + ); +}; + +export default TableOfContents; diff --git a/explorer-nextjs/src/components/breadcrumbs/Breadcrumbs.tsx b/explorer-nextjs/src/components/breadcrumbs/Breadcrumbs.tsx new file mode 100644 index 0000000000..4c5474d6e9 --- /dev/null +++ b/explorer-nextjs/src/components/breadcrumbs/Breadcrumbs.tsx @@ -0,0 +1,70 @@ +import BreadcrumbsMUI from "@mui/material/Breadcrumbs"; +import Typography from "@mui/material/Typography"; +import Link from "next/link"; + +interface BreadcrumbComponentProps { + items: BreadcrumbItemType[]; +} + +interface BreadcrumbItemType { + label: string; + href?: string; + isCurrentPage?: boolean; +} + +export const Breadcrumbs = ({ items }: BreadcrumbComponentProps) => { + return ( + + / + + } + aria-label="breadcrumb" + > + {items.map((item) => { + // Check if it's the current page + if (item.isCurrentPage) { + return ( + + {item.label} + + ); + } + + // If it's not the current page, render a clickable link + return ( + + + {item.label} + + + ); + })} + + ); +};