import React from 'react'; import clsx from 'clsx'; import styles from './styles.module.css'; import { Icon } from '../../atoms'; import { getGlobalStyle } from '../../../helpers'; interface PasswordValidatorProps { password: string; } interface Requirement { label: string; test: (password: string) => boolean; } export const PasswordValidator: React.FC = ({ password }) => { const requirements: Requirement[] = [ { label: 'Al menos una minúscula y una mayúscula', test: (pwd) => /[a-z]/.test(pwd) && /[A-Z]/.test(pwd) }, { label: 'Mínimo 8 caracteres', test: (pwd) => Number(pwd?.length) >= 8 }, { label: 'Al menos un número', test: (pwd) => /\d/.test(pwd) }, ]; return (
); };