{% load i18n %}
<form
	{% if company.id %}
		hx-post="{% url 'company-update' company.id %}"
	{% else %}
		hx-post="{% url 'company-create' %}"
	{% endif %}
	hx-target="#companyForm"
	hx-encoding="multipart/form-data"
	class="oh-profile-section"
>
	{% csrf_token %}
	<div class="oh-inner-sidebar-content__body">
		<div class="oh-input-group mb-2">
			<label for="id_{{form.company.name}}" class=" mb-1">{% trans "Company" %}</label>
			{{form.company}} {{form.company.errors}}
		</div>
		<div class="oh-input-group mb-2">
			<div class="oh-switch">
			<label for="id_{{form.hq.name}}" class=" mb-1 mr-3" style="padding-right: 15px;">{% trans "Hq" %}</label>
				{{form.hq}}
			</div>
		</div>
		<div class="oh-input-group mb-2">
			<label for="id_{{form.address.name}}" class=" mb-1">{% trans "Address" %}</label>
			{{form.address}} {{form.address.errors}}
		</div>
		<div class="oh-input-group mb-2">
			<label for="" class=" mb-1">{% trans "Country" %}</label>
			<select name="country" id="id_country" class="oh-select oh-select-2">
				<option value="{{form.instance.country}}" selected>
					{{form.instance.country}}
				</option>
			</select>
			{{form.country.errors}}
		</div>
		<div class="oh-input-group mb-2">
			<label for="" class=" mb-1">{% trans "State" %}</label>
			<select name="state" id="id_state" class="oh-select oh-select-2">
				<option value="{{form.instance.state}}" selected>
					{{form.instance.state}}
				</option>
			</select>
			{{form.state.errors}}
		</div>
		<div class="oh-input-group mb-2">
			<label for="id_{{form.city.name}}" class=" mb-1">{% trans "City" %}</label>
			{{form.city}} {{form.city.errors}}
		</div>
		<div class="oh-input-group mb-2">
			<label for="id_{{form.zip.name}}" class=" mb-1">{% trans "Zip" %}</label>
			{{form.zip}} {{form.zip.errors}}
		</div>
		<div class="oh-input-group mb-2">
			<label for="id_{{form.icon.name}}" class=" mb-1">{% trans "Icon" %}</label>
			{{form.icon}} {{form.icon.errors}}
		</div>
	</div>
	<div class="oh-modal__dialog-footer p-0 mt-3">
		<button type="submit" class="oh-btn oh-btn--secondary oh-btn--shadow" >
			{% trans "Save" %}
		</button>
	</div>
</form>

<script>
	{% include 'country.js' %}
</script>
