- add morph to relationship - add profile markup - modify page-heading.blade.php to accept center and end sections
30 lines
954 B
PHP
30 lines
954 B
PHP
@props(['variant' => '', 'icon' => '', 'link' => ''])
|
|
@php
|
|
$variants = [
|
|
'neutral' => 'bg-primary-600 text-white',
|
|
'red' => 'bg-red-500 text-white'
|
|
];
|
|
|
|
$variantClass = $variants[$variant] ?? '';
|
|
@endphp
|
|
@if($link !== '')
|
|
<a {{$attributes->merge(['class' => "block px-4 py-2 rounded-lg font-medium hover:opacity-80 $variantClass", 'href' => $link])}}>
|
|
<div class="flex justify-center items-center space-x-2">
|
|
@if($icon !=='')
|
|
@svg("heroicon-o-$icon", 'w-5 h-5')
|
|
@endif
|
|
<p>{{$slot}}</p>
|
|
</div>
|
|
</a>
|
|
@else
|
|
<button {{$attributes->merge(['class' => "px-4 py-2 rounded-lg font-medium hover:opacity-80 $variantClass"])}}>
|
|
<div class="flex justify-center items-center space-x-2">
|
|
@if($icon !=='')
|
|
@svg("heroicon-o-$icon", 'w-5 h-5')
|
|
@endif
|
|
|
|
<p>{{$slot}}</p>
|
|
</div>
|
|
</button>
|
|
@endif
|