mirror of
https://github.com/home-assistant/frontend.git
synced 2025-06-29 13:36:35 +00:00
7 lines
260 B
JavaScript
7 lines
260 B
JavaScript
export default function attributeClassNames(stateObj, attributes) {
|
|
if (!stateObj) return '';
|
|
return attributes.map(function (attribute) {
|
|
return attribute in stateObj.attributes ? 'has-' + attribute : '';
|
|
}).filter(attr => attr !== '').join(' ');
|
|
}
|