-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.jsx
More file actions
118 lines (111 loc) · 4.3 KB
/
layout.jsx
File metadata and controls
118 lines (111 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import React from "react";
import { Link, useLocation } from "react-router-dom";
import { createPageUrl } from "@/utils";
import { Terminal, Server, BookOpen, Settings, ExternalLink } from "lucide-react";
import {
Sidebar,
SidebarContent,
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
SidebarHeader,
SidebarFooter,
SidebarProvider,
SidebarTrigger,
} from "@/components/ui/sidebar";
const navigationItems = [
{
title: "Console",
url: createPageUrl("Dashboard"),
icon: Terminal,
},
{
title: "Servers",
url: createPageUrl("Servers"),
icon: Server,
},
{
title: "Presets",
url: createPageUrl("Presets"),
icon: BookOpen,
},
];
export default function Layout({ children, currentPageName }) {
const location = useLocation();
return (
<SidebarProvider>
<div className="min-h-screen flex w-full bg-gray-900">
<Sidebar className="border-r border-gray-700 bg-gray-800">
<SidebarHeader className="border-b border-gray-700 p-4">
<div className="flex items-center gap-2">
<div className="w-8 h-8 bg-gradient-to-r from-green-500 to-emerald-600 rounded-lg flex items-center justify-center">
<Terminal className="w-5 h-5 text-white" />
</div>
<div>
<h2 className="font-bold text-white">MC RCON Manager</h2>
<p className="text-xs text-gray-400">Remote Console Control</p>
</div>
</div>
</SidebarHeader>
<SidebarContent className="p-2">
<SidebarGroup>
<SidebarGroupLabel className="text-xs font-medium text-gray-400 uppercase tracking-wider px-2 py-2">
Navigation
</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{navigationItems.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton
asChild
className={`hover:bg-gray-700 hover:text-green-400 transition-colors duration-200 rounded-lg mb-1 ${
location.pathname === item.url ? 'bg-gray-700 text-green-400' : 'text-gray-300'
}`}
>
<Link to={item.url} className="flex items-center gap-3 px-3 py-2">
<item.icon className="w-4 h-4" />
<span className="font-medium">{item.title}</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
<SidebarFooter className="border-t border-gray-700 p-4">
<div className="space-y-3">
<div className="text-center">
<p className="text-xs text-gray-400">Made by</p>
<p className="font-semibold text-green-400">Thakc1</p>
</div>
<a
href="https://steamcommunity.com/id/Thakci/"
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-center gap-2 px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg transition-colors duration-200 text-gray-300 hover:text-white text-sm"
>
<ExternalLink className="w-3 h-3" />
Contact Owner
</a>
</div>
</SidebarFooter>
</Sidebar>
<main className="flex-1 flex flex-col bg-gray-900">
<header className="bg-gray-800 border-b border-gray-700 px-6 py-4 md:hidden">
<div className="flex items-center gap-4">
<SidebarTrigger className="hover:bg-gray-700 p-2 rounded-lg transition-colors duration-200 text-gray-300" />
<h1 className="text-xl font-semibold text-white">MC RCON Manager</h1>
</div>
</header>
<div className="flex-1 overflow-auto">
{children}
</div>
</main>
</div>
</SidebarProvider>
);
}