@props([ 'areaLabel' => 'Plot Area', 'areaName' => 'plot_area', 'lengthName' => 'plot_length', 'widthName' => 'plot_width', 'unitName' => 'area_unit', 'unitLabel' => 'Select Unit', 'selectedArea' => old('plot_area'), 'selectedLength' => old('plot_length'), 'selectedWidth' => old('plot_width'), 'selectedUnit' => old('area_unit'), // No default here to show "Select Unit" 'showDimensions' => true, 'id' => 'area-' . uniqid(), ]) @php $unitId = $id . '-unit-selector'; $unitMap = [ 'sqft' => 'Sq. Ft.', 'sqm' => 'Sq. Mtr.', 'acres' => 'Acres', ]; $unitLabels = [ 'sqft' => 'feet', 'sqm' => 'meter', 'acres' => 'acres', ]; // For display purposes, default to 'sqft' but don't select it in dropdown $displayUnit = in_array($selectedUnit, ['sqft', 'sqm', 'acres']) ? $selectedUnit : 'sqft'; @endphp
Length (in {{ $unitLabels[$displayUnit] }})
@error($lengthName) {{ $message }} @enderrorBreadth (in {{ $unitLabels[$displayUnit] }})
@error($widthName) {{ $message }} @enderror