1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #5422: Add icon to attribute name (#2098)

This commit is contained in:
Sergio Betanzos 2022-05-27 11:45:52 +02:00 committed by GitHub
parent f78cbe83eb
commit c3e48a5f45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,7 @@ const Attribute = memo(
handleEdit,
handleGetOptionList,
link,
icon,
name,
path = name,
showActionsOnHover = false,
@ -98,10 +99,16 @@ const Attribute = memo(
variant="body2"
title={typeof name === 'string' ? name : undefined}
flexGrow={1}
sx={
numberOfParents > 0 ? { pl: `${numberOfParents}em` } : undefined
}
sx={{
...(numberOfParents > 0 && { pl: `${numberOfParents}em` }),
...(icon && {
display: 'flex',
alignItems: 'center',
gap: '0.5em',
}),
}}
>
{icon}
{name}
</Typography>
<ActionWrapper {...(showActionsOnHover && { display: 'none' })}>
@ -180,6 +187,7 @@ export const AttributePropTypes = {
handleEdit: PropTypes.func,
handleGetOptionList: PropTypes.func,
link: PropTypes.string,
icon: PropTypes.any,
name: PropTypes.string.isRequired,
path: PropTypes.string,
showActionsOnHover: PropTypes.bool,