fleet/frontend/components/TableContainer/DataTable/TextCell/TextCell.tsx
RachelElysia f6091509f4
Fleet UI: Side bar restyled, update UI for Team/Roles to match Figma (#1659)
* Style all settings side panels
* Add builtin label icons
* Update tests aligning jest userStub and adminUserStub
* Update tests adding cypress checks for user teams/roles
2021-08-16 12:25:51 -04:00

25 lines
511 B
TypeScript

import React from "react";
interface ITextCellProps {
value: string | number | boolean;
formatter?: (val: any) => string;
greyed?: string;
}
const TextCell = (props: ITextCellProps): JSX.Element => {
const {
value,
formatter = (val) => val, // identity function if no formatter is provided
greyed,
} = props;
let val = value;
if (typeof value === "boolean") {
val = value.toString();
}
return <span className={greyed}>{formatter(val)}</span>;
};
export default TextCell;