<.form let={f} for={@changeset} phx_change="validate" phx_submit="save" class="geofence">
<%= label f, :position, gettext("Position"), class: "label" %>
<%= hidden_input f, :latitude %> <%= hidden_input f, :longitude %> <%= hidden_input f, :radius %>
<%= if @show_errors do %>

<%= error_tag(f, :address_id) %> <%= error_tag(f, :latitude) %> <%= error_tag(f, :longitude) %> <%= error_tag(f, :radius) %>

<% end %>
<%= label class: "label" do gettext("Name") end %>
<%= text_input f, :name, class: "input", placeholder: gettext("Name") %>
<%= if @show_errors do %>

<%= error_tag(f, :name) %>

<% end %>
<%= label class: "label" do gettext("Cost") end %>

<%= select f, :billing_type, [{gettext("Per kWh"), :per_kwh}, {gettext("Per Minute"), :per_minute}] %>

<%= text_input f, :cost_per_unit, class: "input", type: :number, inputmode: :decimal, step: 0.0001, placeholder: "0.00" %>

<%= if @show_errors do %>

<%= error_tag(f, :cost_per_unit) %>

<% end %>
<%= label class: "label" do gettext("Session fee") end %>
<%= text_input f, :session_fee, class: "input", type: :number, inputmode: :decimal, min: 0.0, step: 0.01, placeholder: "0.00" %>
<%= if @show_errors do %>

<%= error_tag(f, :session_fee) %>

<% end %>
<%= live_redirect gettext("Back"), to: Routes.live_path(@socket, GeoFenceLive.Index), class: "button" %>
<%= submit gettext("Save"), phx_disable_with: gettext("Saving..."), class: "button is-info" %>