import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; import Stack from "@mui/material/Stack"; import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; import TextInput from "@/Components/v1/Inputs/TextInput/index.jsx"; import Dialog from "@/Components/v1/Dialog/index.jsx"; // Utils import { useTheme } from "@emotion/react"; import { PropTypes } from "prop-types"; import { useTranslation } from "react-i18next"; import { useState } from "react"; const SettingsStats = ({ isAdmin, HEADING_SX, handleChange, settingsData, errors }) => { const theme = useTheme(); const { t } = useTranslation(); const [isOpen, setIsOpen] = useState(false); if (!isAdmin) { return null; } return ( {t("settingsPage.statsSettings.title")} {t("settingsPage.statsSettings.description")} {t("settingsPage.statsSettings.clearAllStatsDescription")} setIsOpen(false)} confirmationButtonLabel={t( "settingsPage.statsSettings.clearAllStatsDialogConfirm" )} onConfirm={() => { const syntheticEvent = { target: { name: "deleteStats", }, }; handleChange(syntheticEvent); setIsOpen(false); }} isLoading={false} /> ); }; SettingsStats.propTypes = { isAdmin: PropTypes.bool, HEADING_SX: PropTypes.object, handleChange: PropTypes.func, settingsData: PropTypes.object, errors: PropTypes.object, }; export default SettingsStats;