File tree 2 files changed +31
-38
lines changed
resources/views/components
2 files changed +31
-38
lines changed Original file line number Diff line number Diff line change
1
+ @props ([
2
+ ' label' ,
3
+ ' variant' => ' default' ,
4
+ ' href' ,
5
+ ] )
6
+
7
+ @php
8
+ $baseClasses = ' block rounded-lg px-4 py-2 text-center transition-all duration-200 ease-out' ;
9
+ $hoverClasses = ' hover:bg-slate-600' ;
10
+
11
+ $variantClasses = match ($variant ) {
12
+ ' highlights' => ' font-bold text-indigo-400' ,
13
+ ' destructive' => ' text-red-400' ,
14
+ default => ' text-slate-200' ,
15
+ };
16
+ @endphp
17
+
18
+ @if ($href )
19
+ <a
20
+ href =" {{ $href } }"
21
+ {{ $attributes -> twMerge ([' class' => " $baseClasses $variantClasses $hoverClasses " ]) } }
22
+ >
23
+ {{ $label } }
24
+ </a >
25
+ @else
26
+ <button
27
+ {{ $attributes -> twMerge ([' class' => " $baseClasses $variantClasses $hoverClasses " ]) } }
28
+ >
29
+ {{ $label } }
30
+ </button >
31
+ @endif
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments