mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
* First stab at new page layouts behind feature toggle * Simplifying PageHeader * Progress on a new model that can more easily support new and old page layouts * Progress * rename folder * Progress * Minor change * fixes * Fixing tests * Make breadcrumbs work * Add tests for old Page component * Adding tests for new Page component and behavior * fixing page header test * Fixed test * AppChrome outside route * Renaming folder * Minor fix * Updated * Fixing StoragePage * Fix for banners Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
43 lines
993 B
TypeScript
43 lines
993 B
TypeScript
import { css } from '@emotion/css';
|
|
import React from 'react';
|
|
|
|
import { NavModelItem, GrafanaTheme2 } from '@grafana/data';
|
|
import { IconName, useStyles2, TabsBar, Tab } from '@grafana/ui';
|
|
|
|
export interface Props {
|
|
navItem: NavModelItem;
|
|
}
|
|
|
|
export function PageTabs({ navItem }: Props) {
|
|
const styles = useStyles2(getStyles);
|
|
|
|
return (
|
|
<div className={styles.tabsWrapper}>
|
|
<TabsBar>
|
|
{navItem.children!.map((child, index) => {
|
|
return (
|
|
!child.hideFromTabs && (
|
|
<Tab
|
|
label={child.text}
|
|
active={child.active}
|
|
key={`${child.url}-${index}`}
|
|
icon={child.icon as IconName}
|
|
href={child.url}
|
|
suffix={child.tabSuffix}
|
|
/>
|
|
)
|
|
);
|
|
})}
|
|
</TabsBar>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const getStyles = (theme: GrafanaTheme2) => {
|
|
return {
|
|
tabsWrapper: css({
|
|
paddingBottom: theme.spacing(3),
|
|
}),
|
|
};
|
|
};
|