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