forked from Prompt-Hash-Stellar/prompt-hash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPositiveIntPicker.tsx
More file actions
44 lines (42 loc) · 961 Bytes
/
Copy pathPositiveIntPicker.tsx
File metadata and controls
44 lines (42 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React from "react";
import { Icon, Input, InputProps } from "@stellar/design-system";
interface PositiveIntPickerProps extends Omit<InputProps, "fieldSize"> {
id: string;
fieldSize?: "sm" | "md" | "lg";
labelSuffix?: string | React.ReactNode;
label: string | React.ReactNode;
value: string;
placeholder?: string;
error: string | undefined;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
readOnly?: boolean;
disabled?: boolean;
}
export const PositiveIntPicker = ({
id,
fieldSize = "md",
labelSuffix,
label,
value,
error,
onChange,
readOnly,
disabled,
...props
}: PositiveIntPickerProps) => {
return (
<Input
id={id}
fieldSize={fieldSize}
label={label}
labelSuffix={labelSuffix}
value={value}
error={error}
onChange={onChange}
readOnly={readOnly}
disabled={disabled}
infoLinkIcon={<Icon.InfoCircle />}
{...props}
/>
);
};