Files
nginx-proxy-manager/frontend/src/modals/CertificateCreateModal/Common/NameField.tsx
T
Jamie Curnow fc2df47753 Add certificate model for http and dns
change is_ecc to boolean, its still stored as int in sqlite
2023-02-28 20:55:40 +10:00

38 lines
772 B
TypeScript

import {
FormControl,
FormErrorMessage,
FormLabel,
Input,
} from "@chakra-ui/react";
import { Field } from "formik";
import { intl } from "locale";
import { validateString } from "modules/Validations";
function NameField() {
return (
<Field name="name" validate={validateString(1, 100)}>
{({ field, form }: any) => (
<FormControl
isRequired
isInvalid={form.errors.name && form.touched.name}>
<FormLabel htmlFor="name">
{intl.formatMessage({
id: "name",
})}
</FormLabel>
<Input
{...field}
id="name"
placeholder={intl.formatMessage({
id: "name",
})}
/>
<FormErrorMessage>{form.errors.name}</FormErrorMessage>
</FormControl>
)}
</Field>
);
}
export { NameField };