{
onFolderClick(item.uid, !isOpen);
}}
name={isOpen ? 'angle-down' : 'angle-right'}
aria-label={
isOpen
? t('browse-dashboards.dashboards-tree.collapse-folder-button', 'Collapse folder {{title}}', {
title: item.title,
})
: t('browse-dashboards.dashboards-tree.expand-folder-button', 'Expand folder {{title}}', {
title: item.title,
})
}
/>
) : (
)}
{isLoading ? : }
{item.url ? (
{
reportInteraction('manage_dashboards_result_clicked');
}}
href={item.url}
className={styles.link}
>
{item.title}
) : (
item.title
)}
>
);
}
const getStyles = (theme: GrafanaTheme2) => {
return {
chevron: css({
marginRight: theme.spacing(1),
width: getSvgSize(CHEVRON_SIZE),
}),
emptyText: css({
// needed for text to truncate correctly
overflow: 'hidden',
}),
// Should be the same size as the so Dashboard name is aligned to Folder name siblings
folderButtonSpacer: css({
paddingLeft: `calc(${getSvgSize(CHEVRON_SIZE)}px + ${theme.spacing(1)})`,
}),
iconNameContainer: css({
alignItems: 'center',
display: 'flex',
gap: theme.spacing(1),
overflow: 'hidden',
}),
link: css({
'&:hover': {
textDecoration: 'underline',
},
}),
};
};