import React from 'react';
import ReactPhoneNumberInput from 'react-phone-number-input/react-hook-form-input';
import { Input } from '@chakra-ui/react';

import 'react-phone-number-input/style.css';

import { PhoneInputType } from './types';

export const PhoneInput: PhoneInputType = (props) => {
  return (
    <ReactPhoneNumberInput
      defaultCountry='RU'
      inputComponent={Input}
      variant='filled'
      {...props}
    />
  );
};
