.form
:let={f}
for={@conn}
class="max-w-md w-full mx-auto bg-white dark:bg-gray-900 shadow-md rounded-sm px-8 pt-6 pb-8 mb-4 mt-8"
onsubmit="confirmButton.disabled = true; return true;"
action={Routes.google_analytics_path(@conn, :import, @site.domain)}
>
Import from Google Analytics
<.input type="hidden" field={f[:access_token]} />
<.input type="hidden" field={f[:refresh_token]} />
<.input type="hidden" field={f[:expires_at]} />
Stats from this property and time period will be imported from
your Google Analytics account to your Plausible dashboard
<.label for={f[:property].id}>Google Analytics property
{@selected_property_name}
<.input type="hidden" value={@selected_property} field={f[:property]} readonly="true" />
<.label for={f[:start_date].id}>From
{PlausibleWeb.EmailView.date_format(@start_date)}
<.input type="hidden" value={@start_date} field={f[:start_date]} readonly="true" />
→
<.label for={f[:end_date].id}>To
{PlausibleWeb.EmailView.date_format(@end_date)}
<.input type="hidden" value={@end_date} field={f[:end_date]} readonly="true" />
Go back
<.button
type="submit"
name="confirmButton"
class="button sm:w-auto w-full [&>span.label-enabled]:block [&>span.label-disabled]:hidden [&[disabled]>span.label-enabled]:hidden [&[disabled]>span.label-disabled]:block"
>
Confirm import
<.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />
Starting import...