All files / src/components/admin/monitoring CategoryBadge.tsx

100% Statements 28/28
100% Branches 3/3
100% Functions 1/1
100% Lines 28/28

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 19x 19x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 1x 1x  
'use client';
 
export interface CategoryBadgeProps {
  /** Error category */
  category: string | null | undefined;
  /** Optional additional className */
  className?: string;
}
 
/**
 * CategoryBadge Component
 *
 * Displays error category with consistent styling.
 */
export function CategoryBadge({ category, className = '' }: CategoryBadgeProps) {
  if (!category) return null;
 
  return (
    <span
      className={`inline-flex items-center px-2 py-0.5 text-xs font-medium rounded bg-gray-200 text-gray-700 dark:bg-gray-600 dark:text-gray-200 ${className}`}
      data-testid="category-badge"
    >
      {category}
    </span>
  );
}
 
export default CategoryBadge;