mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-10-04 15:36:49 +02:00
d783d16eb7
This allows podcasters to reorganize their published episodes as they see fit closes #97
32 lines
687 B
PHP
32 lines
687 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Views\Components;
|
|
|
|
class IconButton extends Button
|
|
{
|
|
public string $glyph = '';
|
|
|
|
public function __construct(array $attributes)
|
|
{
|
|
$iconButtonAttributes = [
|
|
'isSquared' => 'true',
|
|
'title' => $attributes['slot'],
|
|
'data-tooltip' => 'bottom',
|
|
];
|
|
|
|
$glyphSize = [
|
|
'small' => 'text-sm',
|
|
'base' => 'text-lg',
|
|
'large' => 'text-2xl',
|
|
];
|
|
|
|
$allAttributes = array_merge($attributes, $iconButtonAttributes);
|
|
|
|
parent::__construct($allAttributes);
|
|
|
|
$this->slot = icon($this->glyph, $glyphSize[$this->size]);
|
|
}
|
|
}
|