From e4c243d7a696dc1c8256b9f0c36b507c56640499 Mon Sep 17 00:00:00 2001 From: "Anh (Daniel) Le" Date: Thu, 18 Jul 2024 00:15:43 +0700 Subject: [PATCH] fix: format toggle visibility input --- components/shared/toggle-visibility-input.tsx | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/components/shared/toggle-visibility-input.tsx b/components/shared/toggle-visibility-input.tsx index bda228bc..04cebaad 100644 --- a/components/shared/toggle-visibility-input.tsx +++ b/components/shared/toggle-visibility-input.tsx @@ -5,39 +5,39 @@ import { Input, type InputProps } from "../ui/input"; import { toast } from "sonner"; export const ToggleVisibilityInput = ({ ...props }: InputProps) => { - const [isPasswordVisible, setIsPasswordVisible] = useState(false); - const inputRef = useRef(null) + const [isPasswordVisible, setIsPasswordVisible] = useState(false); + const inputRef = useRef(null); - const togglePasswordVisibility = () => { - setIsPasswordVisible((prevVisibility) => !prevVisibility); - }; + const togglePasswordVisibility = () => { + setIsPasswordVisible((prevVisibility) => !prevVisibility); + }; - const copyToClipboard = () => { - if (!inputRef.current) return; + const copyToClipboard = () => { + if (!inputRef.current) return; - const inputElement = inputRef.current; - const text = inputElement.value; + const inputElement = inputRef.current; + const text = inputElement.value; - inputElement.select(); - navigator.clipboard.writeText(text); + inputElement.select(); + navigator.clipboard.writeText(text); - toast.success("Value is copied to clipboard"); - } + toast.success("Value is copied to clipboard"); + }; - const inputType = isPasswordVisible ? "text" : "password"; - return ( -
- - - -
- ); + const inputType = isPasswordVisible ? "text" : "password"; + return ( +
+ + + +
+ ); };