import React from 'react'; import PropTypes from 'prop-types'; import MetricOption from '../../components/MetricOption'; import ColumnOption from '../../components/ColumnOption'; import AggregateOption from './AggregateOption'; import columnType from '../propTypes/columnType'; import savedMetricType from '../propTypes/savedMetricType'; import aggregateOptionType from '../propTypes/aggregateOptionType'; const propTypes = { option: PropTypes.oneOfType([ columnType, savedMetricType, aggregateOptionType, ]).isRequired, }; export default function MetricDefinitionOption({ option }) { if (option.metric_name) { return ( ); } else if (option.column_name) { return ( ); } else if (option.aggregate_name) { return ( ); } notify.error('You must supply either a saved metric, column or aggregate to MetricDefinitionOption'); return null; } MetricDefinitionOption.propTypes = propTypes;