/** @flow */ import * as React from 'react'; import SortIndicator from '../SortIndicator'; import type { HeaderRendererParams } from './types'; import { HeaderLabel } from '../styled'; /** * Default table header renderer. */ export default function defaultHeaderRenderer({ dataKey, label, sortBy, sortDirection, }: HeaderRendererParams) { const showSortIndicator = sortBy === dataKey; const children = [ { label } , ]; if (showSortIndicator) { children.push( , ); } return children; }