update
This commit is contained in:
29
app/components/Breadcrumb.tsx
Normal file
29
app/components/Breadcrumb.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
import { Fragment } from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
interface BreadcrumbItem {
|
||||
href: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const Breadcrumb = ({ navigations }: { navigations: BreadcrumbItem[] }) => {
|
||||
return (
|
||||
<div className={"flex text-xs text-[#13426e]"}>
|
||||
<span className={"mr-2"}>当前位置:</span>
|
||||
{navigations.map((navigation, index) => {
|
||||
if (index === navigations.length - 1) {
|
||||
return <div key={navigation.href}>{navigation.title}</div>;
|
||||
} else {
|
||||
return (
|
||||
<Fragment key={navigation.href}>
|
||||
<Link href={navigation.href}>{navigation.title}</Link>
|
||||
<div className={"mx-2"}>/</div>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Breadcrumb;
|
Reference in New Issue
Block a user