Leon4gr45's picture
Upload folder using huggingface_hub (part 7)
ec4551b verified
Raw
History Blame Contribute Delete
438 Bytes
'use client';
import { usePathname } from 'next/navigation';
import { useMemo } from 'react';
import { useMenuItem } from '@gitroom/frontend/components/layout/top.menu';
export const Title = () => {
const path = usePathname();
const { all: menuItems } = useMenuItem();
const currentTitle = useMemo(() => {
return menuItems.find((item) => path.indexOf(item.path) > -1)?.name;
}, [path]);
return <h1>{currentTitle}</h1>;
};