2021-09-15 15:58:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Views\Components;
|
|
|
|
|
|
|
|
use ViewComponents\Component;
|
|
|
|
|
|
|
|
class IconButton extends Component
|
|
|
|
{
|
|
|
|
public string $glyph = '';
|
|
|
|
|
|
|
|
public function render(): string
|
|
|
|
{
|
2021-09-20 15:45:38 +00:00
|
|
|
$attributes = [
|
|
|
|
'isSquared' => 'true',
|
|
|
|
'title' => $this->slot,
|
2021-11-05 14:36:34 +00:00
|
|
|
'data-tooltip' => 'bottom',
|
2021-09-20 15:45:38 +00:00
|
|
|
];
|
2021-09-15 15:58:21 +00:00
|
|
|
|
2021-09-20 15:45:38 +00:00
|
|
|
$attributes = array_merge($attributes, $this->attributes);
|
|
|
|
|
|
|
|
$attributes['slot'] = icon($this->glyph);
|
|
|
|
|
|
|
|
unset($attributes['glyph']);
|
|
|
|
|
|
|
|
$iconButton = new Button($attributes);
|
|
|
|
return $iconButton->render();
|
2021-09-15 15:58:21 +00:00
|
|
|
}
|
|
|
|
}
|