<div class="mt-0 pb-1">
    <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
        <h6 class="my-0 font-weight-bold text-secondary">Medical Team</h6>
        <span class="mx-2 text-secondary">|</span>
        <div moe class="">
            <a start show>+ Add</a>
            <form url="/api/clientProAccess/create" class="mcp-theme-1">
                <input type="hidden" name="clientUid" value="{{$patient->uid}}">
                <div class="mb-2">
                    <label class="text-secondary text-sm">Pro</label>
                    <select provider-search name="proUid" class="form-control form-control-sm">
                        <option value=""> --select-- </option>
                    </select>
                </div>
                <div class="mb-2">
                    <label for="" class="text-sm text-secondary mb-1">Speciality</label>
                    <input type="text" class="form-control form-control-sm" name="reasonCategory" required>
                </div>
                <div class="mb-2">
                    <label for="" class="text-sm text-secondary mb-1">Memo</label>
                    <input type="text" class="form-control form-control-sm" name="reasonMemo">
                </div>
                <div>
                    <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-sm border-0 m-0">
        <tbody>
        @foreach($patient->medicalTeam as $clientProAccess)
            <tr>
                <td class="text-black p-0 border-0 pb-1">
                    <div class="pb-0 d-flex align-items-center flex-wrap">
                        <div moe class="mr-2">
                            <a start show><i class="on-hover-opaque fa fa-trash-alt text-danger"></i></a>
                            <form url="/api/clientProAccess/deactivate" class="mcp-theme-1">
                                <input type="hidden" name="uid" value="{{$clientProAccess->uid}}">
                                <p class="min-width-200px">Are you sure?</p>
                                <div>
                                    <button submit class="btn btn-sm btn-primary mr-1">Yes</button>
                                    <button cancel class="btn btn-sm btn-default border">No</button>
                                </div>
                            </form>
                        </div>
                        <span class="mr-1 text-nowrap font-weight-bold">{{ $clientProAccess->pro->displayName() }}</span>
                        @if($clientProAccess->reason_category)
                            <span class="mr-1 text-nowrap text-secondary"> / {{$clientProAccess->reason_category}}</span>
                        @endif
                    </div>
                </td>
            </tr>
        @endforeach
        @if(!$patient->medicalTeam || count($patient->medicalTeam) === 0)
            <tr>
                <td class="text-secondary p-0 border-0">
                    No medical team
                </td>
            </tr>
        @endif
        </tbody>
    </table>
</div>

