import React, { useState } from "react"; import { Box, List, ListItem, ListItemIcon, ListItemText, Tabs, Tab, IconButton, FormControl, Select, MenuItem, Typography, } from "@mui/material"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; import SettingsIcon from "@mui/icons-material/Settings"; import SyncIcon from "@mui/icons-material/Sync"; import { useAppDispatch, useAppSelector } from "../../app/hooks"; import { setView, setLanguage } from "./SettingsSlice"; import { AVAILABLE_LANGUAGES } from "./constants"; import { useI18n } from "cozy-ui/transpiled/react/providers/I18n"; import "./SettingsPage.styl"; type SidebarNavItem = "settings" | "sync"; type SettingsSubTab = "settings" | "notifications"; export default function SettingsPage() { const dispatch = useAppDispatch(); const { t, lang } = useI18n(); const [activeNavItem, setActiveNavItem] = useState("settings"); const [activeSettingsSubTab, setActiveSettingsSubTab] = useState("settings"); const handleBackClick = () => { dispatch(setView("calendar")); }; const handleNavItemClick = (item: SidebarNavItem) => { setActiveNavItem(item); if (item === "settings") { setActiveSettingsSubTab("settings"); } }; const handleSettingsSubTabChange = ( _event: React.SyntheticEvent, newValue: SettingsSubTab ) => { setActiveSettingsSubTab(newValue); }; const handleLanguageChange = (event: any) => { dispatch(setLanguage(event.target.value)); }; return (
handleNavItemClick("settings")} sx={{ cursor: "pointer" }} > {/* handleNavItemClick("sync")} sx={{ cursor: "pointer" }} > */} {activeNavItem === "settings" && ( )} {activeNavItem === "settings" && ( <> {activeSettingsSubTab === "settings" && ( {t("settings.language") || "Language"} {t("settings.languageDescription") || "This will be the language used in your Twake Calendar"} )} {activeSettingsSubTab === "notifications" && ( {t("settings.notifications.empty") || "Notifications settings coming soon"} )} )} {activeNavItem === "sync" && ( {t("settings.sync.empty") || "Sync settings coming soon"} )}
); }