All files / shared / components SourceBadge.tsx

65% Statements 13/20
41.66% Branches 5/12
60% Functions 3/5
72.22% Lines 13/18

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 2152x   52x             1504x                 52x   52x
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>
  )
}