defmodule MoonWeb.Pages.Design.PaginationPage do
@moduledoc false
require Logger
use MoonWeb, :live_view
alias MoonWeb.Components.Anatomy
alias MoonWeb.Components.ComponentPageDescription
alias MoonWeb.Components.ExamplesList
alias MoonWeb.Components.Page
alias MoonWeb.Components.PropsTable
alias MoonWeb.Examples.Design.PaginationExample
alias MoonWeb.Components.ExampleAndCode
data(breadcrumbs, :any,
default: [
%{
to: "/components",
name: "Components"
},
%{
to: "/components/v2/pagination",
name: "Pagination"
}
]
)
data(current_page, :integer)
def mount(params, _session, socket) do
{:ok, assign(socket, current_page: String.to_integer(params["page"] || "1"))}
end
def render(assigns) do
~F"""
Pagination is the process of splitting information over multiple pages instead of showing it all on a single page.
Also the name for the interface component used for navigating between these pages.
{component_anatomy()}
<:example>
<:code>{PaginationExample.WithPageHrefs.code()}
"""
end
defp component_anatomy do
"""
......
"""
end
end