NestedFolders: Make TagsCell return null when showing nothing (#67041)

This commit is contained in:
Josh Hunt
2023-04-21 12:17:04 +01:00
committed by GitHub
parent b7f047c8dd
commit 1d0387dcc2

View File

@@ -10,11 +10,11 @@ import { DashboardsTreeItem } from '../types';
export function TagsCell({ row: { original: data } }: CellProps<DashboardsTreeItem, unknown>) {
const styles = useStyles2(getStyles);
const item = data.item;
if (item.kind === 'ui-empty-folder') {
return <></>;
if (item.kind === 'ui-empty-folder' || !item.tags) {
return null;
}
return <TagList className={styles.tagList} tags={item.tags ?? []} />;
return <TagList className={styles.tagList} tags={item.tags} />;
}
function getStyles(theme: GrafanaTheme2) {