mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
refactor: split components Domain Finder
This commit is contained in:
35
assets/components/search/DomainSearchBar.tsx
Normal file
35
assets/components/search/DomainSearchBar.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
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>
|
||||
}
|
||||
Reference in New Issue
Block a user