-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathValueTypeSelect.tsx
More file actions
47 lines (43 loc) · 1.33 KB
/
Copy pathValueTypeSelect.tsx
File metadata and controls
47 lines (43 loc) · 1.33 KB
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
45
46
47
import React from "react";
import { EuiFormRow, EuiSelect } from "@elastic/eui";
import { feast } from "../../protos";
const VALUE_TYPE_OPTIONS = [
{ value: String(feast.types.ValueType.Enum.STRING), text: "STRING" },
{ value: String(feast.types.ValueType.Enum.INT32), text: "INT32" },
{ value: String(feast.types.ValueType.Enum.INT64), text: "INT64" },
{ value: String(feast.types.ValueType.Enum.FLOAT), text: "FLOAT" },
{ value: String(feast.types.ValueType.Enum.DOUBLE), text: "DOUBLE" },
{ value: String(feast.types.ValueType.Enum.BOOL), text: "BOOL" },
{ value: String(feast.types.ValueType.Enum.BYTES), text: "BYTES" },
{
value: String(feast.types.ValueType.Enum.UNIX_TIMESTAMP),
text: "UNIX_TIMESTAMP",
},
];
interface ValueTypeSelectProps {
value: string;
onChange: (value: string) => void;
label?: string;
helpText?: string;
compressed?: boolean;
}
const ValueTypeSelect: React.FC<ValueTypeSelectProps> = ({
value,
onChange,
label = "Value Type",
helpText,
compressed = false,
}) => {
return (
<EuiFormRow label={label} helpText={helpText}>
<EuiSelect
options={VALUE_TYPE_OPTIONS}
value={value}
onChange={(e) => onChange(e.target.value)}
compressed={compressed}
/>
</EuiFormRow>
);
};
export default ValueTypeSelect;
export { VALUE_TYPE_OPTIONS };