grafana/public/app/core/components/sidemenu/SideMenuDropDown.tsx
Ryan McKinley 401615847c
Build: add @grafana/data package (#17436)
first step in moving non-ui components to their own package
2019-06-18 08:17:27 -07:00

27 lines
732 B
TypeScript

import React, { FC } from 'react';
import DropDownChild from './DropDownChild';
import { NavModelItem } from '@grafana/data';
interface Props {
link: NavModelItem;
}
const SideMenuDropDown: FC<Props> = props => {
const { link } = props;
return (
<ul className="dropdown-menu dropdown-menu--sidemenu" role="menu">
<li className="side-menu-header">
<a className="side-menu-header-link" href={link.url}>
<span className="sidemenu-item-text">{link.text}</span>
</a>
</li>
{link.children &&
link.children.map((child, index) => {
return <DropDownChild child={child} key={`${child.url}-${index}`} />;
})}
</ul>
);
};
export default SideMenuDropDown;