{{ define "account/migrate/fragments/progressRows" }}
<tbody
  id="migration-rows"
  {{ if .Migrations.AnyActive }}
    hx-get="/account/migrate/progress/rows"
    hx-trigger="every 3s"
    hx-target="this"
    hx-swap="outerHTML"
  {{ end }}
>
  {{ range .Migrations }}
    <tr class="border-t border-gray-100 dark:border-gray-700">
      <td class="px-3 py-2 truncate">{{ .Name }}</td>
      <td class="px-3 py-2 text-gray-500 dark:text-gray-400 max-w-[8rem] sm:max-w-none truncate">{{ .Knot }}</td>
      <td class="px-3 py-2">
        {{ if eq .Status "done" }}
          <a href="/{{ resolve .OwnerDid.String }}/{{ .Name }}">done</a>
        {{ else if eq .Status "failed" }}
          <span class="error" title="{{ .ErrorMsg }}">failed</span>
        {{ else if eq .Status "running" }}
          <span class="text-blue-600 dark:text-blue-400">running…</span>
        {{ else }}
          <span class="text-gray-500 dark:text-gray-400">pending</span>
        {{ end }}
        {{ if .ErrorMsg }}
          <span class="block sm:inline mt-1 sm:mt-0 text-xs text-gray-500 dark:text-gray-400 break-words">({{ .ErrorMsg }})</span>
        {{ end }}
      </td>
      <td class="px-3 py-2 text-gray-500 dark:text-gray-400 text-xs hidden sm:table-cell">
        {{ if not .UpdatedAt.IsZero }}{{ .UpdatedAt.Format "2006-01-02 15:04:05" }}{{ end }}
      </td>
    </tr>
  {{ end }}
</tbody>
{{ end }}
