2018-04-27 08:42:35 -05:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
|
2018-11-23 08:12:20 -06:00
|
|
|
import { Emitter } from 'app/core/utils/emitter';
|
2019-01-13 16:10:23 -06:00
|
|
|
import { DataQuery } from 'app/types';
|
|
|
|
import { ExploreId } from 'app/types/explore';
|
2018-10-24 04:08:15 -05:00
|
|
|
|
2019-01-13 16:10:23 -06:00
|
|
|
import QueryRow from './QueryRow';
|
2018-04-27 08:42:35 -05:00
|
|
|
|
2019-01-13 16:10:23 -06:00
|
|
|
interface QueryRowsProps {
|
2018-10-24 07:55:56 -05:00
|
|
|
className?: string;
|
2018-11-23 08:12:20 -06:00
|
|
|
exploreEvents: Emitter;
|
2019-01-13 16:10:23 -06:00
|
|
|
exploreId: ExploreId;
|
|
|
|
initialQueries: DataQuery[];
|
2018-04-27 08:42:35 -05:00
|
|
|
}
|
2018-10-24 07:55:56 -05:00
|
|
|
export default class QueryRows extends PureComponent<QueryRowsProps> {
|
2018-04-27 08:42:35 -05:00
|
|
|
render() {
|
2019-01-13 16:10:23 -06:00
|
|
|
const { className = '', exploreEvents, exploreId, initialQueries } = this.props;
|
2018-04-27 08:42:35 -05:00
|
|
|
return (
|
2018-04-27 11:21:20 -05:00
|
|
|
<div className={className}>
|
2018-11-21 09:28:30 -06:00
|
|
|
{initialQueries.map((query, index) => (
|
2019-01-13 16:10:23 -06:00
|
|
|
// TODO instead of relying on initialQueries, move to react key list in redux
|
|
|
|
<QueryRow key={query.key} exploreEvents={exploreEvents} exploreId={exploreId} index={index} />
|
2018-08-03 03:20:13 -05:00
|
|
|
))}
|
2018-04-27 11:21:20 -05:00
|
|
|
</div>
|
2018-04-27 08:42:35 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|