diff --git a/frontend/public/bg.jpg b/frontend/public/bg.jpg new file mode 100644 index 0000000..ef547a4 Binary files /dev/null and b/frontend/public/bg.jpg differ diff --git a/frontend/src/components/PasswordStrengthBar/PasswordStrengthBar.tsx b/frontend/src/components/PasswordStrengthBar/PasswordStrengthBar.tsx new file mode 100644 index 0000000..457c254 --- /dev/null +++ b/frontend/src/components/PasswordStrengthBar/PasswordStrengthBar.tsx @@ -0,0 +1,45 @@ +import { useTranslation } from 'react-i18next' + +type Props = { + password: string +} + +const getPasswordStrength = (password: string) => { + let score = 0 + if (password.length >= 5) score++ + if (/[A-Z]/.test(password)) score++ + if (/[0-9]/.test(password)) score++ + return score +} + +export default function PasswordStrengthBar({ password }: Props) { + const { t } = useTranslation('auth') + + const strength = getPasswordStrength(password || '') + + const getLabel = () => { + if (!password) return t('password.empty') + if (strength < 2) return t('password.weak') + if (strength < 3) return t('password.medium') + return t('password.strong') + } + + const getColor = () => { + if (!password) return 'bg-background-tertiary' + if (strength < 2) return 'bg-error-primary' + if (strength < 3) return 'bg-warning-primary' + return 'bg-success-primary' + } + + return ( +
- The page you're looking for doesn't exist or has been moved. -
-+ Nhập email của bạn. Chúng tôi sẽ gửi mã OTP để đặt lại mật khẩu. +
++ Nhập địa chỉ email liên kết với tài khoản của bạn. Chúng tôi sẽ gửi một mã xác thực (OTP) để thiết lập mật + khẩu mới. +
+Đăng nhập để tiếp tục trải nghiệm
-Chào mừng trở lại
+Khám phá những lợi ích khi tham gia cùng chúng tôi
-{feature.description}
-Tham gia cùng chúng tôi ngay hôm nay
+ {/* HEADER */} +Tham gia mạng lưới AI pháp lí thông minh nhất