All files / shared / components SourceBadge.tsx

68.18% Statements 15/22
41.66% Branches 5/12
66.66% Functions 4/6
75% Lines 15/20

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 2138x   38x   2x         1646x     4x           38x   38x
interface SourceBadgeProps {
  source: 'manual' | 'webhook' | 'api' | 'schedule'
}
 
const colors: Record<string, string> = {
  manual: 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200',
  webhook: 'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200',
  schedule: 'bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200',
  api: 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200',
}
 
export function SourceBadge({ source }: SourceBadgeProps) {
  return (
    <span
      className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${colors[source]}`}
    >
      {source}
    </span>
  )
}