2024-07-29 18:41:36 +02:00
|
|
|
import {Form, Input} from "antd";
|
|
|
|
|
import {t} from "ttag";
|
|
|
|
|
import {SearchOutlined} from "@ant-design/icons";
|
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
|
|
export type FieldType = {
|
|
|
|
|
ldhName: string
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-29 18:54:28 +02:00
|
|
|
export function DomainSearchBar({onFinish}: { onFinish: (values: FieldType) => void }) {
|
2024-07-29 18:41:36 +02:00
|
|
|
|
|
|
|
|
return <Form
|
|
|
|
|
onFinish={onFinish}
|
|
|
|
|
autoComplete="off"
|
2024-08-23 21:19:34 +02:00
|
|
|
style={{width: '100%'}}
|
2024-07-29 18:41:36 +02:00
|
|
|
>
|
|
|
|
|
<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>
|
|
|
|
|
}
|