/**
* Render button HTML.
*
* @param array &$options The button options.
*
* @return string The button HTML.
*
* @since 4.0.0
*/
protected function renderButton(array &$options) : string
{
$this->prepareOptions($options);
// Prepare custom attributes.
unset($options['attributes']['id'], $options['attributes']['class']);
$options['htmlAttributes'] = ArrayHelper::toString($options['attributes']);
// Isolate button class from icon class
$buttonClass = str_replace('icon-', '', $this->getName());
$iconclass = $options['btnClass'] ?? '';
$options['btnClass'] = 'button-' . $buttonClass . ' ' . $iconclass;
// Instantiate a new LayoutFile instance and render the layout
$layout = new FileLayout($this->layout);
return $layout->render($options);
}