@extends('layouts.main')

@section('title', 'Edit Unit of Measure')

@section('content')
<div class="d-flex justify-content-between align-items-center mb-4">
    <h4>Edit Unit of Measure</h4>
</div>

<div class="card">
    <div class="card-body">
        <form method="POST" action="{{ route('unit-of-measures.update', $unitOfMeasure->id) }}">
            @csrf
            @method('PUT')
            <div class="mb-3">
                <label class="form-label">Name *</label>
                <input type="text" name="name" class="form-control" value="{{ old('name', $unitOfMeasure->name) }}" required>
                @error('name') <small class="text-danger">{{ $message }}</small> @enderror
            </div>
            <div class="mb-3">
                <label class="form-label">Abbreviation *</label>
                <input type="text" name="abbreviation" class="form-control" value="{{ old('abbreviation', $unitOfMeasure->abbreviation) }}" placeholder="e.g., pc, kg, L" required>
                @error('abbreviation') <small class="text-danger">{{ $message }}</small> @enderror
            </div>
            
        </form>
    </div>
</div>
@endsection
