'use client' import React from 'react' import {usePathname} from 'next/navigation' const pathToBreadCrumbs = (path: string) => { const mapping: Record = { '/' : 'Kezdőlap', 'about' : 'Rólam', 'services' : 'Szolgáltatásaim', 'prices' : 'Áraim', 'faq' : 'GYIK', } if ( mapping.hasOwnProperty(path)){ return mapping[path]; } return path; } const NextBreadcrumb = () => { const paths = usePathname() const pathNames = paths.split('/').filter( path => path ) return (
{pathToBreadCrumbs( "/" )} { pathNames.map((value) => { return ( {pathToBreadCrumbs( value )} ) }) }
//
// //
) } export default NextBreadcrumb