jadami10 commented on code in PR #9699:
URL: https://github.com/apache/pinot/pull/9699#discussion_r1014435146


##########
pinot-controller/src/main/resources/app/components/SegmentStatusRenderer.tsx:
##########
@@ -0,0 +1,101 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  Chip,
+  makeStyles,
+  Tooltip,
+} from "@material-ui/core";
+import clsx from "clsx";
+import { DISPLAY_SEGMENT_STATUS } from "Models";
+import React, { useEffect, useState } from "react";
+
+const useStyles = makeStyles((theme) => ({
+  error: {
+    color: theme.palette.error.main,
+    border: `1px solid ${theme.palette.error.main}`,
+  },
+  success: {
+    color: theme.palette.success.main,
+    border: `1px solid ${theme.palette.success.main}`,
+  },
+  warning: {
+    color: theme.palette.warning.main,
+    border: `1px solid ${theme.palette.warning.main}`,
+  }
+}));
+
+interface SegmentStatusRendererProps {
+  status: DISPLAY_SEGMENT_STATUS;
+}
+
+export enum StatusColor {
+  Error = "error",
+  Warning = "warning",
+  Success = "success",
+}
+
+export const SegmentStatusRenderer = ({
+  status,
+}: SegmentStatusRendererProps) => {
+  const [statusTooltipTitle, setStatusTooltipTitle] = useState<string>("");
+  const [statusColor, setStatusColor] = useState<StatusColor | null>(
+    null
+  );
+  const segmentStatusRendererClasses = useStyles();
+
+  useEffect(() => {
+    initializeValues();
+  }, []);
+
+  const initializeValues = () => {
+    switch (status) {
+      case DISPLAY_SEGMENT_STATUS.GOOD: {
+        setStatusColor(StatusColor.Success);
+        setStatusTooltipTitle("All the servers of this segment are 
ONLINE/CONSUMING");
+
+        break;
+      }
+      case DISPLAY_SEGMENT_STATUS.BAD: {
+        setStatusColor(StatusColor.Error);
+        setStatusTooltipTitle("One or more servers of this segment are in 
ERROR state");
+
+        break;
+      }
+      case DISPLAY_SEGMENT_STATUS.PARTIAL: {

Review Comment:
   I think I preferred splitting partial vs missing so we don't have to open 
the link to see, but don't want to block you on this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to