Files
grafana/public/app/core/components/sidemenu/DropDownChild.tsx
Torkel Ödegaard 1d689888b0 Prettier: Upgrade to 2 (#30387)
* Updated package json but not updated source files

* Update eslint plugin

* updated files
2021-01-20 07:59:48 +01:00

28 lines
647 B
TypeScript

import React, { FC } from 'react';
import { css } from 'emotion';
import { Icon, IconName, useTheme } from '@grafana/ui';
export interface Props {
child: any;
}
const DropDownChild: FC<Props> = (props) => {
const { child } = props;
const listItemClassName = child.divider ? 'divider' : '';
const theme = useTheme();
const iconClassName = css`
margin-right: ${theme.spacing.sm};
`;
return (
<li className={listItemClassName}>
<a href={child.url}>
{child.icon && <Icon name={child.icon as IconName} className={iconClassName} />}
{child.text}
</a>
</li>
);
};
export default DropDownChild;