@props([ 'href' => '#', 'variant' => 'default', 'external' => false, 'weight' => 'normal', ]) @php $variantClasses = match ($variant) { 'default' => $external ? 'text-blue-600 hover:text-blue-800' : 'text-blue-600 hover:text-blue-800 underline decoration-1 underline-offset-2 hover:decoration-2', 'unstyled' => $external ? 'text-inherit' : 'text-inherit no-underline hover:underline', default => $external ? 'text-blue-600 hover:text-blue-800' : 'text-blue-600 hover:text-blue-800 underline decoration-1 underline-offset-2 hover:decoration-2' }; $textClasses = $external ? match ($variant) { 'default' => 'underline decoration-1 underline-offset-2 hover:decoration-2', 'unstyled' => 'no-underline hover:underline', default => 'underline decoration-1 underline-offset-2 hover:decoration-2' } : ''; $weightClasses = match ($weight) { 'light' => 'font-light', 'normal' => 'font-normal', 'medium' => 'font-medium', 'semibold' => 'font-semibold', 'bold' => 'font-bold', default => 'font-normal' }; $classes = [ $variantClasses, $weightClasses ]; $linkAttributes = [ 'href' => $href, ]; if ($external) { $linkAttributes['target'] = '_blank'; $linkAttributes['rel'] = 'noopener noreferrer'; } @endphp $value) {{ $key }}="{{ $value }}" @endforeach {{ $attributes->class(Arr::toCssClasses($classes)) }} > @if (! $external) {{ $slot }} @endif @if ($external) {{ $slot }} @endif