mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 02:05:36 +00:00
35 lines
948 B
TypeScript
35 lines
948 B
TypeScript
|
|
import {Form, Input} from "antd";
|
||
|
|
import {t} from "ttag";
|
||
|
|
import {SearchOutlined} from "@ant-design/icons";
|
||
|
|
import React from "react";
|
||
|
|
|
||
|
|
export type FieldType = {
|
||
|
|
ldhName: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export function DomainSearchBar({onFinish}: { onFinish: any }) {
|
||
|
|
|
||
|
|
return <Form
|
||
|
|
name="basic"
|
||
|
|
labelCol={{span: 8}}
|
||
|
|
wrapperCol={{span: 16}}
|
||
|
|
onFinish={onFinish}
|
||
|
|
autoComplete="off"
|
||
|
|
>
|
||
|
|
<Form.Item<FieldType>
|
||
|
|
name="ldhName"
|
||
|
|
rules={[{
|
||
|
|
required: true,
|
||
|
|
message: t`Required`
|
||
|
|
}, {
|
||
|
|
pattern: /^(?=.*\.)\S*[^.\s]$/,
|
||
|
|
message: t`This domain name does not appear to be valid`,
|
||
|
|
max: 63,
|
||
|
|
min: 2
|
||
|
|
}]}
|
||
|
|
>
|
||
|
|
<Input size="large" prefix={<SearchOutlined/>} placeholder="example.com" autoFocus={true}
|
||
|
|
autoComplete='off'/>
|
||
|
|
</Form.Item>
|
||
|
|
</Form>
|
||
|
|
}
|