mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-03 04:55:23 +02:00
feat(database): enhance password validation for database schemas and update input components for password visibility
This commit is contained in:
@@ -1,25 +1,16 @@
|
||||
import copy from "copy-to-clipboard";
|
||||
import { Clipboard, EyeIcon, EyeOffIcon } from "lucide-react";
|
||||
import { useRef, useState } from "react";
|
||||
import { Clipboard } from "lucide-react";
|
||||
import { useRef } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { Button } from "../ui/button";
|
||||
import { Input, type InputProps } from "../ui/input";
|
||||
|
||||
export const ToggleVisibilityInput = ({ ...props }: InputProps) => {
|
||||
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const togglePasswordVisibility = () => {
|
||||
setIsPasswordVisible((prevVisibility) => !prevVisibility);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex w-full items-center space-x-2">
|
||||
<Input
|
||||
ref={inputRef}
|
||||
type={isPasswordVisible ? "text" : "password"}
|
||||
{...props}
|
||||
/>
|
||||
<Input ref={inputRef} type={"password"} {...props} />
|
||||
<Button
|
||||
variant={"secondary"}
|
||||
onClick={() => {
|
||||
@@ -29,13 +20,13 @@ export const ToggleVisibilityInput = ({ ...props }: InputProps) => {
|
||||
>
|
||||
<Clipboard className="size-4 text-muted-foreground" />
|
||||
</Button>
|
||||
<Button onClick={togglePasswordVisibility} variant={"secondary"}>
|
||||
{/* <Button onClick={togglePasswordVisibility} variant={"secondary"}>
|
||||
{isPasswordVisible ? (
|
||||
<EyeOffIcon className="size-4 text-muted-foreground" />
|
||||
) : (
|
||||
<EyeIcon className="size-4 text-muted-foreground" />
|
||||
)}
|
||||
</Button>
|
||||
</Button> */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user