blob: 06ed38b1a54ec85b85338f33af4b4315a77170c6 [file] [log] [blame]
Samuel Shuert4f932df2024-09-08 14:04:51 -04001import type { Metadata } from "next";
2import { GeistSans } from "geist/font/sans";
3import { GeistMono } from "geist/font/mono";
4import localFont from "next/font/local";
5import "./globals.css";
6import { Button } from "@/components/ui/button";
7import Link from "next/link";
8import { MonitorIcon, WifiIcon, BluetoothIcon, Volume2Icon } from "lucide-react";
9import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
10import { Separator } from "@/components/ui/separator";
11
12
13const nf = localFont({
14 src: "/fonts/SymbolsNerdFontMono-Regular.ttf",
15 variable: "--font-nf"
16});
17
18
19export const metadata: Metadata = {
20 title: "System Settings",
21 description: "Main system settings page",
22};
23
24const props = { color: "#FFFFFF" };
25const pages: {link: string, icon: JSX.Element, name: string, tooltip: string, colour: string}[] = [
26 {
27 name: "Wifi",
28 link: "/wifi",
29 icon: <WifiIcon {...props} />,
30 tooltip: "Configure WiFi Networks",
31 colour: "blue"// Tailwind's blue-500
32 },
33 {
34 name: "Bluetooth",
35 link: "/bluetooth",
36 icon: <BluetoothIcon {...props} />,
37 tooltip: "Configure and pair bluetooth devices",
38 colour: "blue"
39 },
40 {
41 name: "Sound",
42 link: "/sound",
43 icon: <Volume2Icon {...props} />,
44 tooltip: "Manage inputs and outputs",
45 colour: "red"
46 },
47 // {
48 // name: "VPN",
49 // link: "/bluetooth",
50 // icon: ...
51 // tooltip: "Configure and pair bluetooth devices"
52 // },
53 {
54 name: "Display",
55 link: "/display",
56 icon: <MonitorIcon {...props} />,
57 tooltip: "Modify the layout of your monitors",
58 colour: "green"
59 }
60];
61
62export default function RootLayout({
63 children,
64}: Readonly<{
65 children: React.ReactNode;
66}>) {
67 return (
68 <html lang="en">
69 <body
70 className={`${GeistSans.variable} ${GeistMono.variable} ${nf.variable} antialiased`}
71 >
72 <div className={"grid grid-cols-2 h-screen w-screen font-sans"}>
73 <nav className={"md:w-80 w-fit h-full bg-gray-100 flex flex-col gap-2 p-4 transition ease-in-out duration-75"}>
74 <div className={"flex flex-row"}>
75 {/*
76 For some reason, in dev mode (haven't tried prod), tailwind does not
77 seem to be able to generate the classes for the colours.
78 This is a shitty hack that should be removed later.
79 */}
80 <p className="bg-red-500">R</p>
81 <p className="bg-green-500">G</p>
82 <p className="bg-blue-500">B</p>
83 </div>
84 <div className={"w-full bg-white flex flex-col p-1 rounded-md"}>
85 { pages.map((page, index) => (
86 <TooltipProvider key={index}>
87 <Tooltip>
88 <TooltipTrigger>
89 <Link href={page.link}>
90 <div className="w-full flex flex-row items-center justify-start space-x-4 h-12 px-4">
91 <div className={`w-8 h-8 rounded-sm bg-${page.colour}-500 flex items-center justify-center`}>
92 {page.icon}
93 </div>
94 <span className="text-lg text-left text-black">{page.name}</span>
95 </div>
96 </Link>
97 { (index + 1 < pages.length) && <Separator /> }
98 </TooltipTrigger>
99 <TooltipContent>{page.tooltip}</TooltipContent>
100 </Tooltip></TooltipProvider>
101 ))}
102 </div>
103 </nav>
104 <main>{children}</main>
105 </div>
106 </body>
107 </html>
108 );
109}