<form method="POST" wire:submit.prevent="updateDetail">
    <div class="row mb-2">
        <h5 class="mt-2"><strong>User Detail</strong></h5>
        <div class="col-md-6">
            <div class="input-cont @error('first_name') is-invalid @enderror">
                <label class="form-label">First Name<span>*</span></label>
                <input type="text" class="form-control" placeholder="First Name*" wire:model.defer="first_name">
            </div>
            @error('first_name')
                <span class="invalid-feedback"><strong>{{$message}}</strong></span>
            @enderror
        </div>

        <div class="col-md-6">
            <div class="input-cont @error('last_name') is-invalid @enderror">
                <label class="form-label">Last Name<span>*</span></label>
                <input type="text" class="form-control" placeholder="Last Name*" wire:model.defer="last_name">
            </div>
            @error('last_name') 
                <span class="invalid-feedback"><strong>{{$message}}</strong></span> 
            @enderror
        </div>
    </div>

    <div class="row mb-2">
        <div class="col-md-12">
            <div class="input-cont @error('email') is-invalid @enderror">
                <label class="form-label">Email<span>*</span></label>
                <input type="text" class="form-control" placeholder="Email*" wire:model.defer="email" disabled>
            </div>
            @error('email')
                <span class="invalid-feedback"><strong>{{$message}}</strong></span>
            @enderror
        </div>
    </div>

    <div class="row mb-2">
        <div class="col-md-6">
            <div class="input-cont @error('company_type') is-invalid @enderror">
                <label class="form-label">Compnay Type</label>
                <select class="form-select form-control" wire:model.defer="company_type" aria-label="Default select example">
                    <option selected>Select Company Type</option>
                    @foreach(Config::get('constants.company_types') as $compType)
                        <option value="{{$compType}}">{{$compType}}</option>
                    @endforeach
                </select>
            </div>
            @error('company_type') 
                <span class="invalid-feedback"><strong>{{$message}}</strong></span> 
            @enderror
        </div>

        <div class="col-md-6">
            <div class="input-cont @error('password') is-invalid @enderror">
                <label class="form-label">Password</label>
                <input type="password" class="form-control" placeholder="Password" wire:model.defer="password">
            </div>
            @error('password') 
                <span class="invalid-feedback"><strong>{{$message}}</strong></span> 
            @enderror
        </div>
    </div>

    <div class="row mb-2">
        <h5 class="mt-2"><strong>Company Detail</strong></h5>
    
        <div class="col-md-12">
            <div class="input-cont @error('company_name') is-invalid @enderror">
                <label class="form-label">Company Name<span>*</span></label>
                <input type="text" class="form-control" placeholder="Company Name*" wire:model.defer="company_name">
            </div>
            @error('company_name')
                <span class="invalid-feedback"><strong>{{$message}}</strong></span>
            @enderror
        </div>
    </div>

    <div class="row mb-2">
        <div class="col-md-6">
            <div class="input-cont @error('address') is-invalid @enderror">
                <label class="form-label">Address Line 1<span>*</span></label>
                <input type="text" class="form-control" placeholder="Address Line 1*" wire:model.defer="address">
            </div>
            @error('address')
                <span class="invalid-feedback"><strong>{{$message}}</strong></span>
            @enderror
        </div>

        <div class="col-md-6">
            <div class="input-cont @error('address_2') is-invalid @enderror">
                <label class="form-label">Address Line 2<span>*</span></label>
                <input type="text" class="form-control" placeholder="Last Name*" wire:model.defer="address_2">
            </div>
            @error('address_2') 
                <span class="invalid-feedback"><strong>{{$message}}</strong></span> 
            @enderror
        </div>
    </div>

    <div class="row mb-2">
        <div class="col-md-6">
            <div class="input-cont @error('post_code') is-invalid @enderror">
                <label class="form-label">Post Code<span>*</span></label>
                <input type="text" class="form-control" placeholder="Post Code*" wire:model.defer="post_code">
            </div>
            @error('post_code')
                <span class="invalid-feedback"><strong>{{$message}}</strong></span>
            @enderror
        </div>

        <div class="col-md-6">
            <div class="input-cont @error('country') is-invalid @enderror">
                <label class="form-label">Country<span>*</span></label>
                <select class="form-select form-control" wire:model.defer="country" aria-label="Default select example">
                    <option selected>Select Country*</option>
                    @foreach($countries as $cont)
                        <option value="{{$cont}}">{{$cont}}</option>
                    @endforeach
                </select>
            </div>
            @error('country') 
                <span class="invalid-feedback"><strong>{{$message}}</strong></span> 
            @enderror
        </div>
    </div>

    <div class="row mb-2">    
        <div class="col-md-12">
            <div class="input-cont @error('description') is-invalid @enderror">
                <label class="form-label">Description<span>*</span></label>
                <textarea class="form-control" placeholder="Description*" wire:model.defer="description">{{$description}}</textarea>
            </div>
            @error('description')
                <span class="invalid-feedback"><strong>{{$message}}</strong></span>
            @enderror
        </div>
    </div>

    <button class="post-btn my-4 btn btn-primary" type="submit">Update</button>
</form>