import { useState } from "react"; import { Download, Power, FolderOpen, Wrench, Languages } from "lucide-react"; import { useI18n } from "@/i18n"; import { WindowSettings } from "./WindowSettings"; import { PublicServerSettings } from "./PublicServerSettings"; import { LanguagePicker } from "@/components/LanguagePicker"; import { Card } from "@/components/ui/card"; import { useServerUpdate } from "@/lib/serverUpdate"; import { ServerUpdateCard } from "./ServerUpdateCard"; import { AboutCard } from "./AboutCard"; import { ReleaseHistory, type HistorySelection } from "./ReleaseHistory"; import { ClientCard } from "./ClientCard"; import { GameDataCard } from "./GameDataCard"; import { RealmStartupSettings } from "./RealmStartupSettings"; import { RealmNameSettings } from "./RealmNameSettings"; import { MySqlSettings } from "./MySqlSettings"; import { RestartScheduleSettings } from "./RestartScheduleSettings"; import { AutoRestartSettings } from "./AutoRestartSettings"; import { DiagnosticsCard } from "./DiagnosticsCard"; import { RepairCard } from "./RepairCard"; import { RemoveServerCard } from "./RemoveServerCard"; import { ServerLoggingSettings } from "./ServerLoggingSettings"; const sections = [["updates", Download], ["startup", Power], ["client", FolderOpen], ["service", Wrench], ["interface", Languages]] as const; export function SettingsHome({ serverId, path, onForget }: { serverId: string; serverName?: string; path: string; onForget: () => Promise }) { const { t } = useI18n(); const [section, setSection] = useState<(typeof sections)[number][0]>("updates"); const [attention, setAttention] = useState(false); const update = useServerUpdate(serverId); const [history, setHistory] = useState(() => ({ component: "server", from: update.preview?.from_version ?? undefined, to: update.available ? update.preview?.to_version : undefined })); function showHistory(selection: HistorySelection) { setHistory(selection); requestAnimationFrame(() => { const element = document.getElementById("release-history"); element?.scrollIntoView({ behavior: "smooth", block: "start" }); element?.focus({ preventScroll: true }); }); } return

{t("settings.title")}

{t("settings.organized")}

{attention && section !== "updates" && }
; }