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