adrema/app/View/Ui/Sprite.php

22 lines
379 B
PHP

<?php
namespace App\View\Ui;
use Illuminate\View\Component;
class Sprite extends Component
{
public function __construct(
public string $src = '',
) {
}
public function render()
{
return <<<'HTML'
<svg {{ $attributes->merge(['class' => 'fill-current']) }}><use xlink:href="/sprite.svg#{{$src}}" /></svg>
HTML;
}
}