diff --git a/src/pages/Server.tsx b/src/pages/Server.tsx index c219e3a..5efd034 100644 --- a/src/pages/Server.tsx +++ b/src/pages/Server.tsx @@ -3,6 +3,7 @@ import { ArrowsUpDownIcon, ArrowUpIcon, ChartBarSquareIcon, + CheckIcon, MapIcon, ViewColumnsIcon, } from "@heroicons/react/20/solid"; @@ -16,19 +17,11 @@ import ServerCard from "@/components/ServerCard"; import ServerCardInline from "@/components/ServerCardInline"; import ServerOverview from "@/components/ServerOverview"; import { ServiceTracker } from "@/components/ServiceTracker"; -import { Label } from "@/components/ui/label"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; import { SORT_ORDERS, SORT_TYPES } from "@/context/sort-context"; import { useSort } from "@/hooks/use-sort"; import { useStatus } from "@/hooks/use-status"; @@ -58,6 +51,12 @@ export default function Servers() { ? window.CustomBackgroundImage : undefined; + const currentSortTypeLabel = + sortType === "default" + ? "Default" + : sortType.charAt(0).toUpperCase() + sortType.slice(1); + const _currentSortOrderLabel = sortOrder === "asc" ? "Asc" : "Desc"; + const restoreScrollPosition = useCallback(() => { const savedPosition = sessionStorage.getItem("scrollPosition"); if (savedPosition && containerRef.current) { @@ -367,69 +366,126 @@ export default function Servers() { - -
+ +
+
+
+

+ Sort Servers +

+

+ Choose metric and direction +

+
+ +
+
+
- - +

+ Metric +

+
+ {SORT_TYPES.map((type) => { + const isActive = sortType === type; + const label = + type === "default" + ? "Default" + : type.charAt(0).toUpperCase() + type.slice(1); + + return ( + + ); + })} +
- - +

+ Direction +

+
+ {SORT_ORDERS.map((order) => ( + + ))} +