mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-18 11:36:44 +08:00
### What problem does this PR solve? Fix: Modify the style of the user center ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
32 lines
839 B
TypeScript
32 lines
839 B
TypeScript
// https://originui.com/r/comp-23.json
|
|
|
|
'use client';
|
|
|
|
import React, { useId, useState } from 'react';
|
|
import { Input, InputProps } from '../ui/input';
|
|
|
|
export default React.forwardRef<HTMLInputElement, InputProps>(
|
|
function PasswordInput({ ...props }, ref) {
|
|
const id = useId();
|
|
const [isVisible, setIsVisible] = useState<boolean>(false);
|
|
|
|
const toggleVisibility = () => setIsVisible((prevState) => !prevState);
|
|
|
|
return (
|
|
<div className="*:not-first:mt-2">
|
|
{/* <Label htmlFor={id}>Show/hide password input</Label> */}
|
|
<div className="relative">
|
|
<Input
|
|
id={id}
|
|
className="pe-9"
|
|
placeholder="Password"
|
|
type={isVisible ? 'text' : 'password'}
|
|
ref={ref}
|
|
{...props}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
},
|
|
);
|