github.com/minio/console@v1.4.1/web-app/src/screens/Console/Dashboard/Prometheus/Widgets/UptimeActivityRenderer.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 } 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 UptimeActivityRenderer = ({
    29    valueToRender = "",
    30    loading = false,
    31    iconWidget = null,
    32  }: SimpleWidgetRenderProps) => {
    33    return (
    34      <Box
    35        sx={{
    36          display: "flex",
    37          height: 47,
    38          borderRadius: 2,
    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={<Box>Uptime</Box>}
    50          value={valueToRender}
    51        />
    52      </Box>
    53    );
    54  };
    55  
    56  export default UptimeActivityRenderer;