@props([ 'label' => 'Plot Area', 'name' => 'plot_area', 'type' => 'text', 'placeholder' => '', 'value' => '', 'step' => null, 'unitSelectEnabled' => false, 'unitName' => 'area_unit', 'selectedUnit' => old('area_unit', 'sqft'), 'id' => 'input-' . uniqid(), ]) @php $unitSelectEnabled = filter_var($unitSelectEnabled, FILTER_VALIDATE_BOOLEAN); $unitId = 'unit-selector-' . $id; $unitMap = [ 'sqft' => 'Sq. Ft.', 'sqm' => 'Sq. Mtr.', ]; $dimensionMap = [ 'sqft' => 'Ft', 'sqm' => 'Mtr', ]; $selectedUnit = in_array($selectedUnit, ['sqft', 'sqm', 'acres']) ? $selectedUnit : 'sqft'; $inputType = 'text'; $isNumberField = $type === 'number'; @endphp