<?php
    $userDetailJson = $user->detailJson();
    $phoneNumber = $user->phone_number ?? @$userDetailJson->phone_number;
?>
<div moe relative>
    <a start show href="#">+ Send SMS</a>
    <form url="{{ route('admin.create-new-sms') }}" redir="/admin/users/view/[data]/smses" right>
        <input type="hidden" name="userUid" value="{{ $user->uid }}" />
        <h4 class="fw-bold mb-4">New SMS</h4>
        <div>
            <div class="mb-2">
                <label class="text-sm text-secondary mb-1">From Number<sup class="text-danger">*</sup></label>
                <input type="text" name="fromNumber" class="form-control form-control-sm" value="{{ config('app.phoneNumber') }}" required />
            </div>
            <div class="mb-2">
                <label class="text-sm text-secondary mb-1">To Number<sup class="text-danger">*</sup></label>
                <input type="text" name="toNumber" class="form-control form-control-sm" value="{{ @$phoneNumber }}" required />
            </div>
            <div class="mb-2">
                <label class="text-sm text-secondary mb-1">Message<sup class="text-danger">*</sup></label>
                <textarea name="content" class="form-control form-control-sm" rows="5" required style="height: auto;"></textarea>
            </div>
        </div>
        <div class="d-flex align-items-center mt-3">
            <button type="button" class="btn py-2 btn-grey border w-100 no-shadow" cancel>Cancel</button>
            <button class="btn py-2 btn-primary w-100 ms-3" submit>Send</button>
        </div>
    </form>
</div>