mirror of
https://github.com/vercel/next-learn.git
synced 2026-07-08 22:46:01 +00:00
* Duplicate starter
* Remove code for chapter 16
* Add code for chapter 15
* first 3 chapters
* Remove routes and actions
* chapter 3
* Chapters 12-13
* chapter 5
* Revert "Chapters 12-13"
This reverts commit b6da764d85.
* re-add Link to page
* chapter 5
* chapter 6
* Chapter 11 and 12
* chapter 7
* Revert
* Chapter 11
* Remove PPR flag
* chapter 8
* Chapter 9
* switch from pnpm to npm
* 💅
* Create pnpm-lock.yaml
* build errors
* Fix
* Fix
* Update next
* Update nextauth
---------
Co-authored-by: StephDietz <steph.dietz@vercel.com>
37 lines
940 B
TypeScript
37 lines
940 B
TypeScript
import { clsx } from 'clsx';
|
|
import Link from 'next/link';
|
|
import { lusitana } from '@/app/ui/fonts';
|
|
|
|
interface Breadcrumb {
|
|
label: string;
|
|
href: string;
|
|
active?: boolean;
|
|
}
|
|
|
|
export default function Breadcrumbs({
|
|
breadcrumbs,
|
|
}: {
|
|
breadcrumbs: Breadcrumb[];
|
|
}) {
|
|
return (
|
|
<nav aria-label="Breadcrumb" className="mb-6 block">
|
|
<ol className={clsx(lusitana.className, 'flex text-xl md:text-2xl')}>
|
|
{breadcrumbs.map((breadcrumb, index) => (
|
|
<li
|
|
key={breadcrumb.href}
|
|
aria-current={breadcrumb.active}
|
|
className={clsx(
|
|
breadcrumb.active ? 'text-gray-900' : 'text-gray-500',
|
|
)}
|
|
>
|
|
<Link href={breadcrumb.href}>{breadcrumb.label}</Link>
|
|
{index < breadcrumbs.length - 1 ? (
|
|
<span className="mx-3 inline-block">/</span>
|
|
) : null}
|
|
</li>
|
|
))}
|
|
</ol>
|
|
</nav>
|
|
);
|
|
}
|