mail = (email) => {
    const re = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;
    return re.test(email);
  };
  
  const validateForm = () => {
    const name = getState('form.name', '').trim();
    const email = getState('form.email', '').trim();
    const password = getState('form.password', '');
    
    const errors = {};
    
    if (!name) errors.name = 'Name is required';
    if (!email) {
      errors.email = 'Email is required';
    } else if (!validateEmail(email)) {
      errors.email = 'Please enter a va