@props([
'type' => 'submit',
'name' => null,
'value' => null,
'title' => null,
'href' => null,
'class' => '',
'label' => '',
'btntype' => 'btn-primary',
'disabled' => false,
])
@php
$btnTypeClass = '';
switch ($btntype) {
case 'btn-primary':
$btnTypeClass = 'bg-blue-600 text-white hover:bg-blue-700';
break;
case 'btn-danger':
$btnTypeClass = 'btn bg-red-600 hover:bg-red-700 text-white';
break;
case 'btn-secondary':
$btnTypeClass = 'btn bg-purple-600 hover:bg-purple-700 text-white';
break;
case 'btn-success':
$btnTypeClass = 'btn bg-success-600 hover:bg-success-700 text-white';
break;
case 'btn-info':
$btnTypeClass = 'btn bg-info-600 hover:bg-info-700 text-white';
break;
case 'btn-warning':
$btnTypeClass = 'btn bg-warning-600 hover:bg-warning-700 text-white';
break;
case 'btn-dark':
$btnTypeClass = 'btn bg-neutral-900 hover:bg-neutral-700 text-white';
break;
default:
$btnTypeClass = 'btn bg-primary-600 hover:bg-primary-700 text-white ';
break;
}
@endphp
@if ($label)
@endif
@if (!$href)
@else
merge(['class' => "flex items-center gap-2 px-4 py-2 rounded-lg transition-colors shadow-md $btnTypeClass $class"]) }}
>
{!! $slot !!}
@endif