diff --git a/src/components/Settings/SettingsLayout.tsx b/src/components/Settings/SettingsLayout.tsx index f4b8471c0..efd897e30 100644 --- a/src/components/Settings/SettingsLayout.tsx +++ b/src/components/Settings/SettingsLayout.tsx @@ -2,6 +2,45 @@ import React from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; +interface SettingsRoute { + text: string; + route: string; + regex: RegExp; +} + +const settingsRoutes: SettingsRoute[] = [ + { + text: 'General Settings', + route: '/settings/main', + regex: /^\/settings(\/main)?$/, + }, + { + text: 'Plex', + route: '/settings/plex', + regex: /^\/settings\/plex/, + }, + { + text: 'Services', + route: '/settings/services', + regex: /^\/settings\/services/, + }, + { + text: 'Logs', + route: '/settings/logs', + regex: /^\/settings\/logs/, + }, + { + text: 'Jobs', + route: '/settings/jobs', + regex: /^\/settings\/jobs/, + }, + { + text: 'About', + route: '/settings/about', + regex: /^\/settings\/about/, + }, +]; + const SettingsLayout: React.FC = ({ children }) => { const router = useRouter(); const activeLinkColor = @@ -10,50 +49,71 @@ const SettingsLayout: React.FC = ({ children }) => { const inactiveLinkColor = 'border-transparent text-cool-gray-500 hover:text-cool-gray-400 hover:border-cool-gray-300 focus:outline-none focus:text-cool-gray-4700 focus:border-cool-gray-300'; - const settingsLink = ({ - text, - route, - regex, - }: { - text: string; + const SettingsLink: React.FC<{ route: string; regex: RegExp; - }) => { + isMobile?: boolean; + }> = ({ children, route, regex, isMobile = false }) => { + if (isMobile) { + return ; + } + return ( - {text} + {children} ); }; return ( <> -