{% component_block "modal" id="modal_invoices_from_destination" start_open="true" title="Update FROM info" %}
{% fill "content" %}
<form class="py-4"
      id="modal_invoices_from_destination-form"
      hx-post="{% url 'core:api:finance:invoices:create:set_destination from' %}"
      hx-swap="innerHTML"
      hx-target="#from_destination">
    {% csrf_token %}
    <div class="form-control">
        <label class="label">Name</label>
        <input type="text"
               name="name"
               placeholder="John Smith"
               value="{{ from_name }}"
               class="input input-bordered max-w-full">
    </div>
    <div class="form-control">
        <label class="label">Company</label>
        <input type="text"
               name="company"
               placeholder="Google"
               value="{{ from_company }}"
               class="input input-bordered max-w-full">
    </div>
    <div class="form-control">
        <label class="label">Address</label>
        <input type="text"
               name="address"
               placeholder="128 Road"
               value="{{ from_address }}"
               class="input input-bordered max-w-full">
    </div>
    <div class="form-control">
        <label class="label">City</label>
        <input type="text"
               name="city"
               placeholder="Oxford"
               value="{{ from_city }}"
               class="input input-bordered max-w-full">
    </div>
    <div class="form-control">
        <label class="label">County</label>
        <input type="text"
               name="county"
               placeholder="Oxfordshire"
               value="{{ from_county }}"
               class="input input-bordered max-w-full">
    </div>
    <div class="form-control">
        <label class="label">Country</label>
        <input type="text"
               name="country"
               placeholder="England"
               value="{{ from_country }}"
               class="input input-bordered max-w-full">
    </div>
    <div class="modal-action">
        <button type="submit"
                onclick="document.getElementById('modal_invoices_from_destination').close();"
                id="modal_invoices_from_destination-action-btn"
                class="btn btn-primary">Save</button>
        <button type="reset" class="btn btn-error">Reset</button>
        <button type="button"
                onclick="document.getElementById('modal_invoices_from_destination').close();"
                class="btn">Close</button>
    </div>
</form>
{% endfill %}
{% endcomponent_block %}
