18 lines
799 B
PHP
18 lines
799 B
PHP
@props(['sr_text' => false,'button' => false,'a' => false])
|
|
@php $td_class = "relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6"; @endphp
|
|
@php $link_class = "text-indigo-600 hover:text-indigo-900"; @endphp
|
|
<td {{ $attributes->merge(['class' => $td_class]) }}>
|
|
@if($a)
|
|
<a {{ $a->attributes->merge(['class' => $link_class]) }}>
|
|
{{ $a }}@if($sr_text)<span class="sr-only">{{ $sr_text }}</span>@endif
|
|
</a>
|
|
@elseif($button)
|
|
@php($aria_label = $button . $sr_text)
|
|
<button {{ $button->attributes->merge(['class' => $link_class, 'aria-label'=> $aria_label]) }}>
|
|
{{ $button }}
|
|
</button>
|
|
@else
|
|
{{ $slot }}{{ $sr_text ? '<span class="sr-only">' . $sr_text . '</span>' : '' }}
|
|
@endif
|
|
</td>
|