diff --git a/app/dashboard/servers/Servers.tsx b/app/dashboard/servers/Servers.tsx index 7b09fc7..aa80a01 100644 --- a/app/dashboard/servers/Servers.tsx +++ b/app/dashboard/servers/Servers.tsx @@ -64,6 +64,7 @@ import Chart from 'chart.js/auto' import NextLink from "next/link" import { Toaster } from "@/components/ui/sonner" import { toast } from "sonner" +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu" interface ServerHistory { labels: string[]; @@ -173,10 +174,9 @@ export default function Dashboard() { const customInputRef = useRef(null); const debounceTimerRef = useRef(null); - const toggleLayout = () => { - const newLayout = !isGridLayout; - setIsGridLayout(newLayout); - Cookies.set("layoutPreference-servers", newLayout ? "grid" : "standard", { + const toggleLayout = (gridLayout: boolean) => { + setIsGridLayout(gridLayout); + Cookies.set("layoutPreference-servers", gridLayout ? "grid" : "standard", { expires: 365, path: "/", sameSite: "strict", @@ -541,17 +541,26 @@ export default function Dashboard() {
Your Servers -
- - - - - - {isGridLayout ? "Switch to list view" : "Switch to grid view"} - - +
+ + + + + + toggleLayout(false)}> + List View + + toggleLayout(true)}> + Grid View + + +