qlik-oss/sn-table

View on GitHub
src/table/pagination-table/utils/get-cell-renderer.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { StyledBodyCell } from "../components/body/styles";
import withColumnStyling from "../components/body/withColumnStyling";
import withSelections from "../components/body/withSelections";
import withStyling from "../components/body/withStyling";

export default function getCellRenderer(hasColumnStyling: boolean, isSelectionsEnabled: boolean) {
  // withStyling always runs last, applying whatever styling it gets
  let cell = withStyling(StyledBodyCell);
  if (isSelectionsEnabled) cell = withSelections(cell);
  if (hasColumnStyling) cell = withColumnStyling(cell);
  return cell;
}