import { css } from '@emotion/css'; import React from 'react'; import { NavModelItem, GrafanaTheme2 } from '@grafana/data'; import { useStyles2, TabsBar, Tab, toIconName } from '@grafana/ui'; export interface Props { navItem: NavModelItem; } export function PageTabs({ navItem }: Props) { const styles = useStyles2(getStyles); return (
{navItem.children!.map((child, index) => { const icon = child.icon ? toIconName(child.icon) : undefined; return ( !child.hideFromTabs && ( ) ); })}
); } const getStyles = (theme: GrafanaTheme2) => { return { tabsWrapper: css({ paddingBottom: theme.spacing(3), }), }; };