QueryRows.tsx 847 B

123456789101112131415161718192021222324252627
  1. import React, { PureComponent } from 'react';
  2. import { Emitter } from 'app/core/utils/emitter';
  3. import { DataQuery } from 'app/types';
  4. import { ExploreId } from 'app/types/explore';
  5. import QueryRow from './QueryRow';
  6. interface QueryRowsProps {
  7. className?: string;
  8. exploreEvents: Emitter;
  9. exploreId: ExploreId;
  10. initialQueries: DataQuery[];
  11. }
  12. export default class QueryRows extends PureComponent<QueryRowsProps> {
  13. render() {
  14. const { className = '', exploreEvents, exploreId, initialQueries } = this.props;
  15. return (
  16. <div className={className}>
  17. {initialQueries.map((query, index) => (
  18. // TODO instead of relying on initialQueries, move to react key list in redux
  19. <QueryRow key={query.key} exploreEvents={exploreEvents} exploreId={exploreId} index={index} />
  20. ))}
  21. </div>
  22. );
  23. }
  24. }