defmodule PetalComponents.Pagination do use Phoenix.Component alias PetalComponents.Heroicons import PetalComponents.Link # prop path, :string # prop class, :string # prop sibling_count, :integer # prop boundary_count, :integer # prop link_type, :string, options: ["a", "live_patch", "live_redirect"] @doc """ In the `path` param you can specify :page as the place your page number will appear. e.g "/posts/:page" => "/posts/1" """ def pagination(assigns) do assigns = assigns |> assign_new(:class, fn -> "" end) |> assign_new(:link_type, fn -> "a" end) |> assign_new(:sibling_count, fn -> 1 end) |> assign_new(:boundary_count, fn -> 1 end) |> assign_new(:path, fn -> "/:page" end) ~H"""