github.com/minio/console@v1.4.1/web-app/src/screens/Console/Dashboard/Prometheus/Widgets/HealActivityRenderer.tsx (about) 1 // This file is part of MinIO Console Server 2 // Copyright (c) 2021 MinIO, Inc. 3 // 4 // This program is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Affero General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Affero General Public License for more details. 13 // 14 // You should have received a copy of the GNU Affero General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 16 17 import React from "react"; 18 import { Box, breakPoints } from "mds"; 19 import TimeStatItem from "../../TimeStatItem"; 20 21 export type SimpleWidgetRenderProps = { 22 valueToRender?: any; 23 loading?: boolean; 24 title?: any; 25 id?: number; 26 iconWidget?: any; 27 }; 28 const HealActivityRenderer = ({ 29 valueToRender = "", 30 loading = false, 31 iconWidget = null, 32 }: SimpleWidgetRenderProps) => { 33 return ( 34 <Box 35 sx={{ 36 display: "flex", 37 height: "47px", 38 borderRadius: "2px", 39 40 "& .dashboard-time-stat-item": { 41 height: "100%", 42 width: "100%", 43 }, 44 }} 45 > 46 <TimeStatItem 47 loading={loading} 48 icon={iconWidget} 49 label={ 50 <Box> 51 <Box 52 sx={{ 53 display: "inline", 54 [`@media (max-width: ${breakPoints.sm}px)`]: { 55 display: "none", 56 }, 57 }} 58 > 59 Time since last 60 </Box>{" "} 61 Heal Activity 62 </Box> 63 } 64 value={valueToRender} 65 /> 66 </Box> 67 ); 68 }; 69 70 export default HealActivityRenderer;