// Components import { Stack, Typography } from "@mui/material"; import { TabPanel } from "@mui/lab"; import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; import Checkbox from "@/Components/v1/Inputs/Checkbox/index.jsx"; import TextInput from "@/Components/v1/Inputs/TextInput/index.jsx"; import Search from "@/Components/v1/Inputs/Search/index.jsx"; import ImageUpload from "@/Components/v1/Inputs/ImageUpload/index.jsx"; import ColorPicker from "@/Components/v1/Inputs/ColorPicker/index.jsx"; import Progress from "../Progress/index.jsx"; // Utils import { useTheme } from "@emotion/react"; import timezones from "../../../../../Utils/timezones.json"; import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; import { useMemo, useState, useCallback } from "react"; const TabSettings = ({ isCreate, tabValue, form, handleFormChange, handleImageChange, progress, removeLogo, errors, }) => { // Utils const theme = useTheme(); const { t } = useTranslation(); const [rawInput, setRawInput] = useState(""); const selectedTimezone = useMemo( () => timezones.find((tz) => tz._id === form.timezone) ?? null, [form.timezone] ); const handleTimezoneChange = useCallback( (newValue) => { setRawInput(""); handleFormChange({ target: { name: "timezone", value: newValue?._id ?? "", }, }); }, [handleFormChange] ); return ( {t("access")} {t("statusPageCreateSettings")} {t("basicInformation")} {t("statusPageCreateBasicInfoDescription")} {t("timezone")} {t("statusPageCreateSelectTimeZoneDescription")} setRawInput(newVal)} handleChange={handleTimezoneChange} isAdorned={true} unit="timezone" /> {t("statusPageCreateAppearanceTitle")} {t("statusPageCreateAppearanceDescription")} ); }; TabSettings.propTypes = { isCreate: PropTypes.bool, tabValue: PropTypes.string, form: PropTypes.object, handleFormChange: PropTypes.func, handleImageChange: PropTypes.func, progress: PropTypes.object, removeLogo: PropTypes.func, errors: PropTypes.object, }; export default TabSettings;