mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 06:43:06 +00:00
20 lines
479 B
TypeScript
20 lines
479 B
TypeScript
import type { ComponentProps } from 'react'
|
|
import { FormInput } from './FormInput'
|
|
|
|
export const EmailInput = (props: ComponentProps<'input'>) => (
|
|
<FormInput
|
|
name="email"
|
|
id="email"
|
|
placeholder="Digite seu e-mail"
|
|
autoComplete="email"
|
|
format={sanitize}
|
|
inputMode="email"
|
|
type="text"
|
|
minLength={5}
|
|
maxLength={254}
|
|
required
|
|
{...props}
|
|
/>
|
|
)
|
|
|
|
const sanitize = (value: string) => value.toLowerCase().replace(/\s+/g, '').slice(0, 254)
|