import * as React from 'react';
import NewFieldParent from "./NewFieldParent";
import {FormControlLabel} from "@mui/material";
import SelectMask from "../SelectMask";
import CustomizedSwitch from "@ui_kit/CustomSwitch";



interface Props {
    switchState: string,
    drawerNewFieldHC:(a:string)=>void
}


export default function SwitchNewField({switchState ='name', drawerNewFieldHC}: Props) {
    const [SwitchMask, setSwitchMask] = React.useState(false);
    const SwitchMaskHC = (bool:boolean) => {
        setSwitchMask(bool)
    }

    switch (switchState) {
        case 'name':
            return (<NewFieldParent drawerNewFieldHC={drawerNewFieldHC} placeholderHelp={'Введите имя'} placeholderField={'Дмитрий'} defaultValue={'name'}/>);
            break;
        case 'email':
            return (<NewFieldParent drawerNewFieldHC={drawerNewFieldHC}  placeholderHelp={'Введите Email'} placeholderField={'mail@example.ru'} defaultValue={'email'}/>);
            break;
        case 'phone':

            return (
                <NewFieldParent drawerNewFieldHC={drawerNewFieldHC}  placeholderHelp={'Введите номер'} placeholderField={'+7 900 000 00 00'} defaultValue={'phone'}>
                    {/* <FormControlLabel
                        value="start"
                        control={<CustomizedSwitch/>}
                        label="Маска для телефона"
                        labelPlacement="start"
                        sx={{
                            display: 'flex',
                            justifyContent: 'space-between'
                        }}
                        onClick={() => {
                            SwitchMaskHC(!SwitchMask)
                        }}

                    /> */}

                    {SwitchMask ?
                        <SelectMask/>
                        :
                        <></>
                    }
                </NewFieldParent>
            );
            break;
        case 'text':
            return (<NewFieldParent drawerNewFieldHC={drawerNewFieldHC}  placeholderHelp={'Введите фамилию'} placeholderField={'Иванов'} defaultValue={'text'}/>);
            break;
        case 'address':
            return (<NewFieldParent drawerNewFieldHC={drawerNewFieldHC}  placeholderHelp={'Введите адрес'} placeholderField={'Москва, Лаврушинский пер., 10'} defaultValue={'address'}/>);
            break;
        default:
            return (<></>)
    }
}