2025-01-09 00:40:28 +03:00
|
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
import { usePathname } from 'next/navigation';
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
|
|
const Breadcrumbs: React.FC = () => {
|
|
|
|
|
const pathname = usePathname();
|
|
|
|
|
const pathSegments = pathname.split('/').filter(segment => segment);
|
|
|
|
|
|
|
|
|
|
const correctName = {
|
|
|
|
|
events: "мероприятия сообщества",
|
2025-01-14 18:28:14 +03:00
|
|
|
|
"event-1": "базовая программа подготовки гештальт-терапевтов - добор",
|
2025-01-09 00:40:28 +03:00
|
|
|
|
participants: "участники",
|
2025-01-14 18:28:14 +03:00
|
|
|
|
1: "кириллов кирилл кириллович"
|
2025-01-09 00:40:28 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<nav className="max-w-[1032px] mx-auto">
|
|
|
|
|
<ol className="flex text-middleGrey font-[350] my-[50px]">
|
|
|
|
|
<li>
|
|
|
|
|
<Link href="/">главная</Link>
|
|
|
|
|
</li>
|
|
|
|
|
{pathSegments.map((segment, index) => {
|
|
|
|
|
const href = '/' + pathSegments.slice(0, index + 1).join('/');
|
|
|
|
|
return (
|
|
|
|
|
<li key={href}>
|
|
|
|
|
<Link href={href}><span className="mx-[2px]">/</span>{correctName[decodeURIComponent(segment) as keyof typeof correctName]}</Link>
|
|
|
|
|
</li>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</ol>
|
|
|
|
|
</nav>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Breadcrumbs;
|