phantasmal-world/src/old/core/ui/TextInput.tsx
2019-08-21 17:56:46 +02:00

23 lines
649 B
TypeScript

import * as React from "react";
import { ChangeEvent, Component, FocusEvent, ReactNode } from "react";
import { Input } from "antd";
export class TextInput extends Component<{
value: string;
max_length: number;
on_change: (e: ChangeEvent<HTMLInputElement>) => void;
on_blur?: (e: FocusEvent<HTMLInputElement>) => void;
}> {
render(): ReactNode {
return (
<Input
value={this.props.value}
maxLength={this.props.max_length}
onChange={this.props.on_change}
onBlur={this.props.on_blur}
size="small"
/>
);
}
}