import { Box, InputAdornment, TextField as MuiTextField, TextFieldProps, Typography, useTheme } from "@mui/material"; import {useRootContainerSize} from "@contexts/RootContainerWidthContext.ts"; import {useQuizData} from "@contexts/QuizDataContext.ts"; import {useIMask} from "react-imask"; import {quizThemes} from "@utils/themes/Publication/themePublication.ts"; import {FC, useState} from "react"; import { CountrySelector } from "@/components/ViewPublicationPage/ContactForm/CustomInput/CountrySelector/CountrySelector.tsx"; import {phoneMasksByCountry} from "@utils/phoneMasksByCountry.tsx"; type InputProps = { title: string; desc: string; Icon: FC<{ color: string; backgroundColor: string }>; onChange: TextFieldProps["onChange"]; id: string; isPhone?:boolean }; const TextField = MuiTextField as unknown as FC; export const CustomInput = ({ title, desc, Icon, onChange ,isPhone}: InputProps) => { const theme = useTheme(); const isMobile = useRootContainerSize() < 600; const { settings } = useQuizData(); const [mask, setMask] = useState(phoneMasksByCountry['RU'][1]); const { ref } = useIMask({mask}); return ( {title} ), endAdornment: ( {isPhone && ( )} ), }} /> ); };