cockpit-plugin-base-react - v1.1.1
    Preparing search index...

    Function StatusBadge

    • Renders a PatternFly Label whose color and text are driven by a config map.

      Type Parameters

      • T extends string

      Parameters

      • __namedParameters: Props<T>

      Returns Element

      const STATUS_CONFIG: Record<ServiceStatus, StatusBadgeConfig> = {
      active: { color: "green", label: "Active" },
      failed: { color: "red", label: "Failed" },
      };
      <StatusBadge status={serviceStatus} config={STATUS_CONFIG} />