fleet/frontend/components/forms/fields/InputFieldHiddenContent/InputFieldHiddenContent.tsx
Ian Littman 2891904f31
🤖 Switch InputField + InputFieldWithIcon JSX components to TS, add more test coverage, fix Storybook build (#43307)
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
2026-04-09 08:41:48 -05:00

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;