import React from 'react'; import { NoContent } from 'UI'; import { Styles, AvgLabel } from '../../common'; import { withRequest } from 'HOCs' import { AreaChart, Area, CartesianGrid, Tooltip, ResponsiveContainer, XAxis, YAxis } from 'recharts'; import { toUnderscore } from 'App/utils'; import { NO_METRIC_DATA } from 'App/constants/messages' const WIDGET_KEY = 'resourcesLoadingTime'; export const RESOURCE_OPTIONS = [ { text: 'All', value: 'all', }, { text: 'JS', value: "SCRIPT", }, { text: 'CSS', value: "STYLESHEET", }, { text: 'Fetch', value: "REQUEST", }, { text: 'Image', value: "IMG", }, { text: 'Media', value: "MEDIA", }, { text: 'Other', value: "OTHER", }, ]; interface Props { data: any optionsLoading: any fetchOptions: any options: any metric?: any } function ResourceLoadingTime(props: Props) { const { data, metric } = props; const gradientDef = Styles.gradientDef(); return ( <>
{gradientDef} Styles.tickFormatter(val)} label={{ ...Styles.axisLabelLeft, value: "Resource Fetch Time (ms)" }} />
); } export default withRequest({ dataName: "options", initialData: [], dataWrapper: data => data, loadingName: 'optionsLoading', requestName: "fetchOptions", endpoint: '/dashboard/' + toUnderscore(WIDGET_KEY) + '/search', method: 'GET' })(ResourceLoadingTime)