- {data.playerScores.map((playerScore, index) => {
- return
;
- })}
+
+
+ {Object.keys(ScoreSort).map((sort, index) => (
+
+ ))}
+
+
+ {previousScores.playerScores.map((playerScore, index) => (
+
+ ))}
+
+
+ {
+ setCurrentPage(newPage);
+ }}
+ />
);
}
diff --git a/src/app/components/ui/pagination.tsx b/src/app/components/ui/pagination.tsx
new file mode 100644
index 0000000..4e72d36
--- /dev/null
+++ b/src/app/components/ui/pagination.tsx
@@ -0,0 +1,121 @@
+import * as React from "react"
+import {
+ ChevronLeftIcon,
+ ChevronRightIcon,
+ DotsHorizontalIcon,
+} from "@radix-ui/react-icons"
+
+import { cn } from "@/app/common/utils"
+import { ButtonProps, buttonVariants } from "@/app/components/ui/button"
+
+const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
+
+)
+Pagination.displayName = "Pagination"
+
+const PaginationContent = React.forwardRef<
+ HTMLUListElement,
+ React.ComponentProps<"ul">
+>(({ className, ...props }, ref) => (
+
+))
+PaginationContent.displayName = "PaginationContent"
+
+const PaginationItem = React.forwardRef<
+ HTMLLIElement,
+ React.ComponentProps<"li">
+>(({ className, ...props }, ref) => (
+
+))
+PaginationItem.displayName = "PaginationItem"
+
+type PaginationLinkProps = {
+ isActive?: boolean
+} & Pick
&
+ React.ComponentProps<"a">
+
+const PaginationLink = ({
+ className,
+ isActive,
+ size = "icon",
+ ...props
+}: PaginationLinkProps) => (
+
+)
+PaginationLink.displayName = "PaginationLink"
+
+const PaginationPrevious = ({
+ className,
+ ...props
+}: React.ComponentProps) => (
+
+
+ Previous
+
+)
+PaginationPrevious.displayName = "PaginationPrevious"
+
+const PaginationNext = ({
+ className,
+ ...props
+}: React.ComponentProps) => (
+
+ Next
+
+
+)
+PaginationNext.displayName = "PaginationNext"
+
+const PaginationEllipsis = ({
+ className,
+ ...props
+}: React.ComponentProps<"span">) => (
+
+
+ More pages
+
+)
+PaginationEllipsis.displayName = "PaginationEllipsis"
+
+export {
+ Pagination,
+ PaginationContent,
+ PaginationLink,
+ PaginationItem,
+ PaginationPrevious,
+ PaginationNext,
+ PaginationEllipsis,
+}
diff --git a/src/app/hooks/use-window-dimensions.ts b/src/app/hooks/use-window-dimensions.ts
new file mode 100644
index 0000000..9785b40
--- /dev/null
+++ b/src/app/hooks/use-window-dimensions.ts
@@ -0,0 +1,24 @@
+import { useEffect, useState } from "react";
+
+function getWindowDimensions() {
+ const { innerWidth: width, innerHeight: height } = window;
+ return {
+ width,
+ height,
+ };
+}
+
+export default function useWindowDimensions() {
+ const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions());
+
+ useEffect(() => {
+ function handleResize() {
+ setWindowDimensions(getWindowDimensions());
+ }
+
+ window.addEventListener("resize", handleResize);
+ return () => window.removeEventListener("resize", handleResize);
+ }, []);
+
+ return windowDimensions;
+}