DataTableColumnLevelIndicator.tsx 587 B

123456789101112131415161718192021222324252627
  1. import { cn } from 'ui'
  2. import { LEVELS } from '../DataTable.constants'
  3. import { getLevelColor } from '../DataTable.utils'
  4. export const DataTableColumnLevelIndicator = ({
  5. value,
  6. className,
  7. dotClassName,
  8. }: {
  9. value: (typeof LEVELS)[number]
  10. className?: string
  11. dotClassName?: string
  12. }) => {
  13. return (
  14. <div className={cn('flex items-center justify-center', className)}>
  15. <div
  16. className={cn(
  17. 'h-2 w-2 rounded-full',
  18. getLevelColor(value).bg,
  19. getLevelColor(value).border,
  20. dotClassName
  21. )}
  22. />
  23. </div>
  24. )
  25. }