mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
31 lines
639 B
TypeScript
31 lines
639 B
TypeScript
import React from 'react'
|
|
import type { ControllerRenderProps } from 'react-hook-form';
|
|
|
|
import {
|
|
Input,
|
|
FormControl,
|
|
FormLabel,
|
|
} from '@chakra-ui/react';
|
|
|
|
const HASH_LENGTH = 66;
|
|
|
|
type Props = {
|
|
field: ControllerRenderProps<any, 'transaction'>;
|
|
isInvalid: boolean;
|
|
}
|
|
|
|
const AddressInput: React.FC<Props> = ({ field, isInvalid }) => {
|
|
return (
|
|
<FormControl variant="floating" id="transaction" isRequired>
|
|
<Input
|
|
{ ...field }
|
|
isInvalid={ isInvalid }
|
|
maxLength={ HASH_LENGTH }
|
|
/>
|
|
<FormLabel>Transaction hash (0x...)</FormLabel>
|
|
</FormControl>
|
|
)
|
|
}
|
|
|
|
export default AddressInput
|