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 21 22 2367x   67x                 2366x                 67x   67x
interface SourceBadgeProps {
  source: 'manual' | 'api' | 'schedule' | 'vikunja' | 'gitea' | 'github'
}
 
const colors: Record<string, string> = {
  manual: 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-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',
  vikunja: 'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200',
  gitea: 'bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200',
  github: 'bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-zinc-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>
  )
}