'use client'; import { Configurations, ServerTab } from '@/lib/schemas/config'; import { ConfigurationEditor } from '@/components/configuration/ConfigurationEditor'; import { AssistRulesEditor } from '@/components/configuration/AssistRulesEditor'; import { EventConfigEditor } from '@/components/configuration/EventConfigEditor'; import { EventRulesEditor } from '@/components/configuration/EventRulesEditor'; import { ServerSettingsEditor } from '@/components/configuration/ServerSettingsEditor'; import { StatisticsDashboard } from '@/components/statistics/StatisticsDashboard'; import { LeaderboardManager } from '@/components/leaderboard/LeaderboardManager'; import { useState } from 'react'; import { StateHistoryStats } from '@/lib/schemas'; import { Leaderboard } from '@/lib/schemas/leaderboard'; interface ServerConfigurationTabsProps { serverId: string; configurations: Configurations; statistics: StateHistoryStats; leaderboard: Leaderboard; } const tabs = [ { id: ServerTab.statistics, name: 'Statistics', icon: '📊' }, { id: ServerTab.configuration, name: 'Configuration', icon: '⚙️' }, { id: ServerTab.assistRules, name: 'Assist Rules', icon: '🚗' }, { id: ServerTab.event, name: 'Event Config', icon: '🏁' }, { id: ServerTab.eventRules, name: 'Event Rules', icon: '📋' }, { id: ServerTab.settings, name: 'Server Settings', icon: '🔧' }, { id: ServerTab.leaderboard, name: 'Leaderboard', icon: '🏆' } ]; export function ServerConfigurationTabs({ serverId, configurations, statistics, leaderboard }: ServerConfigurationTabsProps) { const [currentTab, setCurrentTab] = useState(ServerTab.statistics); const [configData, setConfigData] = useState(configurations.configuration); const [configRestart, setConfigRestart] = useState(true); const [assistData, setAssistData] = useState(configurations.assistRules); const [assistRestart, setAssistRestart] = useState(true); const [eventData, setEventData] = useState(configurations.event); const [eventRestart, setEventRestart] = useState(true); const [eventRulesData, setEventRulesData] = useState(configurations.eventRules); const [eventRulesRestart, setEventRulesRestart] = useState(true); const [settingsData, setSettingsData] = useState(configurations.settings); const [settingsRestart, setSettingsRestart] = useState(true); const renderTabContent = () => { switch (currentTab) { case ServerTab.statistics: return ; case ServerTab.configuration: return ( ); case ServerTab.assistRules: return ( ); case ServerTab.event: return ( ); case ServerTab.eventRules: return ( ); case ServerTab.settings: return ( ); case ServerTab.leaderboard: return ; default: return (
🚧

Tab Not Found

The requested tab could not be found.

); } }; return (
{renderTabContent()}
); }