quick hide input
This commit is contained in:
@@ -71,10 +71,19 @@ const Input = (props: {
|
|||||||
field: "apiKey" | "apiEndpoint";
|
field: "apiKey" | "apiEndpoint";
|
||||||
help: string;
|
help: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
const [hideInput, setHideInput] = useState(false);
|
||||||
return (
|
return (
|
||||||
<Help help={props.help}>
|
<Help help={props.help}>
|
||||||
<label className="m-2 p-2">{props.field}</label>
|
<label className="m-2 p-2">{props.field}</label>
|
||||||
|
<span
|
||||||
|
className="m-2 p-2"
|
||||||
|
onClick={(event: any) => setHideInput(!hideInput)}
|
||||||
|
>
|
||||||
|
<label>hide</label>
|
||||||
|
<input type="checkbox" checked={hideInput} />
|
||||||
|
</span>
|
||||||
<input
|
<input
|
||||||
|
type={hideInput ? "password" : "text"}
|
||||||
className="m-2 p-2 border rounded focus w-32 md:w-fit"
|
className="m-2 p-2 border rounded focus w-32 md:w-fit"
|
||||||
value={props.chatStore[props.field]}
|
value={props.chatStore[props.field]}
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user