import React from 'react';
import PropTypes from 'prop-types';
import { ChartTitle } from '@bufferapp/analyze-shared-components';
const getTitle = (metricType) => {
switch (metricType) {
case 'day':
return 'Which is the best day to post?';
case 'type':
return 'Which is the best type of post?';
case 'frequency':
return 'Which is the best frequency to post?';
default:
break;
}
};
const Title = ({ forReport, metricType }) => (
<ChartTitle forReport={forReport}>
{getTitle(metricType)}
</ChartTitle>
);
Title.propTypes = {
forReport: PropTypes.bool,
};
Title.defaultProps = {
forReport: false,
};
export default Title;
|