2024-05-09 17:55:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Views\Components;
|
|
|
|
|
2024-05-29 10:24:13 +00:00
|
|
|
use Override;
|
2024-05-09 17:55:41 +00:00
|
|
|
use ViewComponents\Component;
|
|
|
|
|
|
|
|
class Hint extends Component
|
|
|
|
{
|
|
|
|
protected array $attributes = [
|
|
|
|
'data-tooltip' => 'bottom',
|
|
|
|
'tabindex' => '0',
|
|
|
|
];
|
|
|
|
|
2024-05-29 10:24:13 +00:00
|
|
|
#[Override]
|
2024-05-09 17:55:41 +00:00
|
|
|
public function render(): string
|
|
|
|
{
|
|
|
|
$this->attributes['title'] = $this->slot;
|
|
|
|
|
|
|
|
$this->mergeClass('inline-block align-middle opacity-75');
|
|
|
|
|
|
|
|
$icon = icon('question-fill');
|
|
|
|
|
|
|
|
return <<<HTML
|
|
|
|
<span {$this->getStringifiedAttributes()}>{$icon}</span>
|
|
|
|
HTML;
|
|
|
|
}
|
|
|
|
}
|