Skip to content

Commit

Permalink
Create FormPasswordInput.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Ktbch authored May 9, 2024
1 parent 777b172 commit 2179048
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/frontend/design-system/components/Form/FormPasswordInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useLingui } from "@lingui/react";
import { ISharedFormInput } from "./_types";
import { generateFormArias, wrapLabelAndError } from "./_wrapForm";
import { Input } from "./Styles";

interface IFormInput extends ISharedFormInput {
type?: "password" | "text";
}

export const FormPasswordInput = (formInput: IFormInput) => {
const { input, type, disabled, meta, placeholder, ...rest } = formInput;
const { _ } = useLingui();
return wrapLabelAndError(
<Input
{...input}
{...rest}
{...generateFormArias(meta)}
type={type}
id={formInput.input.name}
placeholder={placeholder ? _(placeholder) : null}
disabled={disabled}
/>,
formInput
);
};

0 comments on commit 2179048

Please sign in to comment.