Files
pse.dev/components/breadcrumbs.tsx
2025-03-14 14:53:58 +00:00

31 lines
719 B
TypeScript

import NextLink from 'next/link'
interface Props {
path: string[]
}
const Breadcrumbs = ({ path }: Props) => {
return (
<div className="flex text-[#4A5754]">
{path.map((item, index) => {
const isLastItem = index === path.length - 1
if (isLastItem) {
return (
<p key={index} className="cursor-pointer font-bold capitalize">
{item}
</p>
)
}
return (
<NextLink key={index} href={`/${item}`} className={'capitalize'}>
{item === 'projects' ? 'All Projects' : item}
<span className="mx-2">/</span>
</NextLink>
)
})}
</div>
)
}
export default Breadcrumbs