QueryRows.tsx 896 B

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