23 lines
959 B
PHP
23 lines
959 B
PHP
@php
|
|
$state = $getState(); // Get the current state of the radio group
|
|
$options = $getOptions(); // Assuming you have a method to get options in your component
|
|
$name = $getName(); // Get the field name for the input
|
|
@endphp
|
|
|
|
<div>
|
|
@foreach ($options as $value => $label)
|
|
<label class="cursor-pointer">
|
|
<div
|
|
@if ($state === $value) class="flex border border-red-500 p-2" @else class="flex gap-3 border border-amber-500 p-12" @endif>
|
|
<input type="radio" name="{{ $name }}" value="{{ $value }}"
|
|
@if ($state === $value) checked @endif {{ $attributes->merge(['class' => 'form-radio']) }}
|
|
wire:model="{{ $name }}">
|
|
<h1 class="scroll-m-20 text-3xl md:text-4xl font-black tracking-tight lg:text-5xl text-shadow-sm">
|
|
{{ $label }}
|
|
</h1>
|
|
</div>
|
|
</label>
|
|
<br>
|
|
@endforeach
|
|
</div>
|