<%= form_for @conn, Routes.google_analytics_path(@conn, :import, @site.domain), [class: "max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>

Import from Google Analytics

<%= hidden_input(f, :access_token, value: @access_token) %> <%= hidden_input(f, :refresh_token, value: @refresh_token) %> <%= hidden_input(f, :expires_at, value: @expires_at) %> <%= hidden_input(f, :legacy, value: @legacy) %>
Stats from this <%= if @property? do %> property <% else %> view <% end %> and time period will be imported from your Google Analytics account to your Plausible dashboard
<%= styled_label( f, :property_or_view, "Google Analytics #{if @property?, do: "property", else: "view"}" ) %> <%= @selected_property_or_view_name %> <%= hidden_input(f, :property_or_view, readonly: "true", value: @selected_property_or_view ) %>
<%= styled_label(f, :start_date, "From") %> <%= PlausibleWeb.EmailView.date_format(@start_date) %> <%= hidden_input(f, :start_date, value: @start_date, readonly: "true") %>
→
<%= styled_label(f, :end_date, "To") %> <%= PlausibleWeb.EmailView.date_format(@end_date) %> <%= hidden_input(f, :end_date, value: @end_date, readonly: "true") %>
<%= submit("Confirm import", class: "button mt-6") %> <% end %>