mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Zed + Opus 4.6; prompt: Convert the InputField JSX component to TypeScript and remove the ts-ignore directives that we no longer need after doing so. - [x] Changes file added - [x] Automated tests updated
40 lines
906 B
TypeScript
40 lines
906 B
TypeScript
import React from "react";
|
|
|
|
import InputField from "components/forms/fields/InputField";
|
|
import classnames from "classnames";
|
|
|
|
const baseClass = "input-field-hidden-content";
|
|
|
|
interface IInputFieldHiddenContentProps {
|
|
value: string;
|
|
name?: string;
|
|
className?: string;
|
|
helpText?: string | JSX.Element;
|
|
}
|
|
|
|
/** Used to easily create an InputField with a show/hide and copy buttion */
|
|
const InputFieldHiddenContent = ({
|
|
value,
|
|
name,
|
|
className,
|
|
helpText,
|
|
}: IInputFieldHiddenContentProps) => {
|
|
const classNames = classnames(baseClass, className);
|
|
|
|
return (
|
|
<div className={classNames}>
|
|
<InputField
|
|
readOnly
|
|
inputWrapperClass={`${baseClass}__secret-input`}
|
|
name={name}
|
|
enableShowSecret
|
|
enableCopy
|
|
type={"password"}
|
|
value={value}
|
|
helpText={helpText}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default InputFieldHiddenContent;
|