mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-02-20 07:37:26 -05:00
28 lines
661 B
TypeScript
28 lines
661 B
TypeScript
import { Eye, EyeClosed } from '@phosphor-icons/react';
|
|
import { Button, Tooltip } from '@sd/ui';
|
|
|
|
interface Props {
|
|
showPassword: boolean;
|
|
setShowPassword: (value: boolean) => void;
|
|
}
|
|
|
|
const ShowPassword = ({ showPassword, setShowPassword }: Props) => {
|
|
return (
|
|
<Tooltip
|
|
className="absolute inset-y-0 right-1 flex items-center"
|
|
position="top"
|
|
label="Show password"
|
|
>
|
|
<Button
|
|
variant="gray"
|
|
className="flex size-6 items-center justify-center !p-0"
|
|
onClick={() => setShowPassword(!showPassword)}
|
|
>
|
|
{!showPassword ? <EyeClosed size={12} /> : <Eye size={12} />}
|
|
</Button>
|
|
</Tooltip>
|
|
);
|
|
};
|
|
|
|
export default ShowPassword;
|