import React from 'react'; import { Loader, NoContent } from 'UI'; import { widgetHOC, Styles } from '../common'; import { BarChart, Bar, CartesianGrid, Tooltip, Legend, ResponsiveContainer, XAxis, YAxis } from 'recharts'; import { LAST_24_HOURS, LAST_30_MINUTES, YESTERDAY, LAST_7_DAYS } from 'Types/app/period'; const customParams = rangeName => { const params = { density: 28 } if (rangeName === LAST_24_HOURS) params.density = 28 if (rangeName === LAST_30_MINUTES) params.density = 28 if (rangeName === YESTERDAY) params.density = 28 if (rangeName === LAST_7_DAYS) params.density = 28 return params } @widgetHOC('resourcesByParty', { fullwidth: true, customParams }) export default class ErrorsByOrigin extends React.PureComponent { render() { const { data, loading, period, compare = false, showSync = false } = this.props; const colors = compare ? Styles.compareColors : Styles.colors; const params = customParams(period.rangeName) return ( 1st Party} dataKey="firstParty" stackId="a" fill={colors[0]} /> 3rd Party} dataKey="thirdParty" stackId="a" fill={colors[2]} /> ); } }