All files / features / pipelines / hooks usePipelineColumns.tsx

100% Statements 5/5
75% Branches 3/4
100% Functions 4/4
100% Lines 5/5

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 23 24 25 26 27 28 29 30 31 32 33 34 3569x     26x         24x                           24x           24x            
import type { Column } from '@/shared/components/DataTable'
import type { components } from '@/types/api'
 
type Pipeline = components['schemas']['Pipeline']
 
export function usePipelineColumns(): Column<Pipeline>[] {
  return [
    {
      key: 'name',
      label: 'Name',
      sortable: true,
      render: (item) => (
        <a
          href={`#/pipelines/${item.id}`}
          className="text-primary underline-offset-4 hover:underline"
        >
          {item.name}
        </a>
      ),
    },
    {
      key: 'description',
      label: 'Description',
      sortable: true,
      render: (item) => item.description || '\u2014',
    },
    {
      key: 'enabled',
      label: 'Status',
      sortable: true,
      render: (item) => (item.enabled ? '\u2705' : '\u274C'),
    },
  ]
}