Files
SCM-Manager/scm-ui/ui-components/src/table/TextColumn.tsx

22 lines
475 B
TypeScript
Raw Normal View History

2019-12-02 13:58:56 +01:00
import React, { FC } from "react";
import { ColumnProps } from "./types";
import comparators from "../comparators";
2019-11-29 15:57:36 +01:00
type Props = ColumnProps & {
dataKey: string;
};
const TextColumn: FC<Props> = ({ row, dataKey }) => {
return row[dataKey];
};
TextColumn.defaultProps = {
createComparator: (props: Props) => {
return comparators.byKey(props.dataKey);
2019-11-29 17:13:39 +01:00
},
2019-12-02 13:58:56 +01:00
ascendingIcon: "sort-alpha-down-alt",
descendingIcon: "sort-alpha-down"
2019-11-29 15:57:36 +01:00
};
export default TextColumn;