{{ define "title" }}Migrate from GitHub{{ end }}

{{ define "content" }}
  <div class="p-6">
    <p class="text-xl font-bold dark:text-white">Migrate from GitHub</p>
    <p class="text-gray-500 dark:text-gray-400 pb-2">
      Enter a GitHub username to list their public repositories.
    </p>
  </div>
  <div class="bg-white dark:bg-gray-800 p-6 rounded w-full mx-auto drop-shadow-sm dark:text-white flex flex-col gap-4">
    <form
      hx-post="/account/migrate/listGitHubRepos"
      hx-target="#source-repos"
      hx-swap="innerHTML"
      class="flex flex-wrap gap-2 items-center"
    >
      <input
        type="text"
        name="username"
        required
        placeholder="GitHub username"
        class="border border-gray-300 dark:border-gray-700 rounded px-2 py-1 bg-transparent flex-1 min-w-0"
      />
      <button type="submit" class="btn">Load repos</button>
    </form>

    <span id="migrate-error" class="error"></span>

    {{ if not .Knots }}
      <p class="text-gray-500 dark:text-gray-400">
        You aren't a member of any knot yet. Join or register a knot first.
      </p>
    {{ end }}

    <div id="source-repos"></div>
  </div>
{{ end }}
