Files
ragflow/web/src/components/originui/password-input.tsx
chanx 653b785958 Fix: Modify the style of the user center #10703 (#11419)
### 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)
2025-11-21 09:33:50 +08:00

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>
);
},
);