--- import { type SidebarItemLink } from "../../consts"; import { getIsRtlFromUrl, getLanguageFromURL } from "../../languages"; import { paginate } from "../../utils"; import LeftArrow from "../Icons/LeftArrow.astro"; import RightArrow from "../Icons/RightArrow.astro"; const currentPage = Astro.url.pathname; const hasTrailing = currentPage.endsWith("/"); const currentPageMatch = currentPage.slice( 1, hasTrailing ? -1 : currentPage.length, ) as SidebarItemLink; const langCode = getLanguageFromURL(currentPage); const { next, prev } = paginate(langCode, currentPageMatch); const { pathname } = Astro.url; const isRtl = getIsRtlFromUrl(pathname); ---