/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the Chameleon License found in the * LICENSE file in the root directory of this source tree. */ interface Props { label: string; status: string; category?: StatusCategory; } export type StatusCategory = | "success" | "warning" | "error" | "info" | "neutral" | "green"; import { CheckmarkFilled, WarningAltFilled, ErrorFilled, InformationFilled, HelpFilled, } from "@carbon/icons-react"; export function StatusBadge({ label, status, category = "neutral" }: Props) { const extra = ""; const colorMap = (cat: string) => { const map = { success: ( ), green: ( ), warning: ( ), error: , info: ( ), }; return ( map[cat] || ); }; return (
{colorMap(category)}
{label}
); }