             <td class="border border-gray-light">
               <LinkButton title="Parse"
                           to={opml_path(Endpoint, :import, opml.id)}
-                          class="border-primary-dark bg-primary hover:bg-primary-light text-white" />
+                          class="text-sm border-primary-dark bg-primary hover:bg-primary-light text-white" />
               <LinkButton title="Show"
-                          class="border-gray bg-white hover:bg-gray-light"
+                          class="text-sm border-gray bg-white hover:bg-gray-light"
                           to={opml_path(Endpoint, :show, opml.id)} />
               <LinkButton title="Edit"
-                          class="border-warning-dark bg-warning hover:bg-warning-light text-white"
+                          class="text-sm border-warning-dark bg-warning hover:bg-warning-light text-white"
                           to={opml_path(Endpoint, :edit, opml.id)} />
               <LinkButton title="Delete"
                           to={opml_path(Endpoint, :delete, opml.id)}
                           method={:delete}
-                          class="border-danger-dark bg-danger hover:bg-danger-light text-white"
+                          class="text-sm border-danger-dark bg-danger hover:bg-danger-light text-white"
                           opts={[confirm: "Are you sure?"]} />
             </td>
           </tr>

      </tbody>
    </table>

    <LinkButton title="New opml"
                to={opml_path(Endpoint, :new)} />
    """


  alias PanWeb.{Opml, Endpoint}
  alias PanWeb.Surface.LinkButton
  alias PanWeb.Surface.Admin.{SortLink, Pagination}
  import PanWeb.Router.Helpers

  def mount(_params, _session, socket) do
    socket = assign(socket, sort_by: :inserted_at, sort_order: :desc, page: 1, per_page: 10)

    {:ok, socket |> fetch() |> paginate()}
  end

  defp fetch(%{assigns: %{sort_by: sort_by, sort_order: sort_order}} = socket) do
    opmls =
      Opml.all_with_user(sort_by, sort_order)
      |> Enum.map(&Map.put_new(&1, :user_name, &1.user.name))

    assign(socket,
      opmls: opmls,
      nr_of_unfiltered: Enum.count(opmls),
      nr_of_filtered: Enum.count(opmls)
    )
  end

  defp paginate(%{assigns: %{page: page, per_page: per_page, opmls: opmls}} = socket) do
    assign(socket, filtered_opmls: Enum.slice(opmls, (page - 1) * per_page, per_page))
  end

  defp sort(%{assigns: %{sort_by: sort_by, sort_order: sort_order, opmls: opmls}} = socket) do
    sorted_opmls = Enum.sort_by(opmls, &Map.get(&1, sort_by), sort_order)
    assign(socket, opmls: sorted_opmls)
  end

  def handle_event("paginate", %{"page" => page}, socket) do
    {:noreply, assign(socket, page: String.to_integer(page)) |> paginate()}
  end

  def handle_event("sort", %{"sort-by" => sort_by, "sort-order" => sort_order}, socket) do
    {:noreply,
     assign(socket, sort_by: String.to_atom(sort_by), sort_order: String.to_atom(sort_order))
     |> sort()
     |> paginate()}
  end

  def render(assigns) do
