github.com/minio/console@v1.4.1/web-app/src/screens/Console/Dashboard/Prometheus/Widgets/ExpandGraphLink.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, ExpandIcon } from "mds";
    19  
    20  import { IDashboardPanel } from "../types";
    21  
    22  import { openZoomPage } from "../../dashboardSlice";
    23  import { useAppDispatch } from "../../../../../store";
    24  
    25  const ExpandGraphLink = ({ panelItem }: { panelItem: IDashboardPanel }) => {
    26    const dispatch = useAppDispatch();
    27    return (
    28      <Box
    29        sx={{
    30          alignItems: "right",
    31          gap: "10px",
    32          "& .link-text": {
    33            color: "#2781B0",
    34            fontSize: "12px",
    35            fontWeight: 600,
    36          },
    37  
    38          "& .zoom-graph-icon": {
    39            backgroundColor: "transparent",
    40            border: 0,
    41            padding: 0,
    42            cursor: "pointer",
    43            "& svg": {
    44              color: "#D0D0D0",
    45              height: 16,
    46            },
    47            "&:hover": {
    48              "& svg": {
    49                color: "#404143",
    50              },
    51            },
    52          },
    53        }}
    54      >
    55        <button
    56          onClick={() => {
    57            dispatch(openZoomPage(panelItem));
    58          }}
    59          className={"zoom-graph-icon"}
    60        >
    61          <ExpandIcon />
    62        </button>
    63      </Box>
    64    );
    65  };
    66  
    67  export default ExpandGraphLink;