Initial Commit
This commit is contained in:
commit
ddf09fe00c
113 changed files with 187148 additions and 0 deletions
33
resources/views/components/button.blade.php
Normal file
33
resources/views/components/button.blade.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
@props(['href' => false, 'type' => 'default'])
|
||||
|
||||
@php
|
||||
|
||||
switch($type) {
|
||||
case 'info':
|
||||
$color = 'bg-blue-400 hover:bg-blue-500';
|
||||
break;
|
||||
case 'success':
|
||||
$color = 'bg-green-400 hover:bg-green-500';
|
||||
break;
|
||||
case 'warning':
|
||||
$color = 'bg-yellow-400 hover:bg-yellow-500';
|
||||
break;
|
||||
case 'danger':
|
||||
$color = 'bg-red-400 hover:bg-red-500';
|
||||
break;
|
||||
default:
|
||||
$color = 'bg-gray-400 hover:bg-gray-500';
|
||||
}
|
||||
|
||||
if ($href) {
|
||||
$element = 'a';
|
||||
$attributes = $attributes->merge([ 'href' => $href ]);
|
||||
} else {
|
||||
$element = 'button';
|
||||
}
|
||||
|
||||
@endphp
|
||||
|
||||
<{{$element}} {{ $attributes->merge(['class' => "inline-block px-4 py-2 rounded $color"]) }}>
|
||||
{{ $slot }}
|
||||
</{{$element}}>
|
||||
Reference in a new issue