forked from mirrors/thatmattlove-hyperglass
22 lines
574 B
JavaScript
22 lines
574 B
JavaScript
import React from "react";
|
|
import ChakraSelect from "~/components/ChakraSelect";
|
|
|
|
const buildQueries = queryTypes => {
|
|
const queries = [];
|
|
queryTypes.map(q => {
|
|
queries.push({ value: q.name, label: q.display_name });
|
|
});
|
|
return queries;
|
|
};
|
|
|
|
export default ({ queryTypes, onChange }) => {
|
|
const queries = buildQueries(queryTypes);
|
|
return (
|
|
<ChakraSelect
|
|
size="lg"
|
|
name="query_type"
|
|
onChange={e => onChange({ field: "query_type", value: e.value })}
|
|
options={queries}
|
|
/>
|
|
);
|
|
};
|