{ settings.map( ( setting, index ) => {
return (
setting.isShown( props ) && (
!! setting.hasValue( props )
}
onDeselect={ () => {
setting.resetValue( props );
if (
!! setting?.resetClassnames
) {
const newClassNames = {
...setting.resetClassnames(
props
),
};
props.setAttributes( {
className:
classnames(
props
.attributes
.className,
{
...newClassNames,
}
),
} );
}
} }
label={ setting.label }
className={ classnames(
'block-editor-tools-panel-color-gradient-settings__item',
{
first: 0 === index,
}
) }
>
(
) }
renderContent={ () => (
{
setting.label
}
) }
/>
)
);
} ) }