revamp template
This commit is contained in:
24
src/layouts/demo2/toolbar/ToolbarHeading.tsx
Normal file
24
src/layouts/demo2/toolbar/ToolbarHeading.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { useMenus } from '@/providers';
|
||||
import { useMenuCurrentItem } from '@/components';
|
||||
import { useLocation } from 'react-router';
|
||||
import { ToolbarBreadcrumbs } from './ToolbarBreadcrumbs';
|
||||
|
||||
export interface IToolbarHeadingProps {
|
||||
title?: string | ReactNode;
|
||||
}
|
||||
|
||||
const ToolbarHeading = ({ title = '' }: IToolbarHeadingProps) => {
|
||||
const { getMenuConfig } = useMenus();
|
||||
const { pathname } = useLocation();
|
||||
const currentMenuItem = useMenuCurrentItem(pathname, getMenuConfig('primary'));
|
||||
|
||||
return (
|
||||
<div className="flex items-center flex-wrap gap-1 lg:gap-5">
|
||||
<h1 className="font-medium text-lg text-gray-900">{title || currentMenuItem?.title}</h1>
|
||||
<ToolbarBreadcrumbs />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { ToolbarHeading };
|
||||
Reference in New Issue
Block a user