mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 10:56:44 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
0eb8689a27
commit
fa8bee0e36
7 changed files with 271 additions and 0 deletions
36
src/components/mika/PasswordStrengthMeter.tsx
Normal file
36
src/components/mika/PasswordStrengthMeter.tsx
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"use client";
|
||||
|
||||
import { passwordStrength, passwordStrengthLabel } from "@/lib/password";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function PasswordStrengthMeter({ password }: { password: string }) {
|
||||
if (!password) return null;
|
||||
const score = passwordStrength(password);
|
||||
const colors = [
|
||||
"bg-destructive",
|
||||
"bg-destructive",
|
||||
"bg-warning",
|
||||
"bg-success",
|
||||
];
|
||||
return (
|
||||
<div className="space-y-1.5" aria-live="polite">
|
||||
<div className="flex gap-1">
|
||||
{[0, 1, 2].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
className={cn(
|
||||
"h-1.5 flex-1 rounded-full transition-colors",
|
||||
i < score ? colors[score] : "bg-muted",
|
||||
)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<p className={cn(
|
||||
"text-xs",
|
||||
score < 2 ? "text-destructive" : score === 2 ? "text-warning" : "text-success",
|
||||
)}>
|
||||
Força: {passwordStrengthLabel(score)}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue