mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 17:28:54 +00:00
24 lines
530 B
TypeScript
24 lines
530 B
TypeScript
import React from "react";
|
|
import classnames from "classnames";
|
|
|
|
interface IStatusCellProps {
|
|
value: string;
|
|
}
|
|
|
|
const generateClassTag = (rawValue: string): string => {
|
|
return rawValue.replace(" ", "-").toLowerCase();
|
|
};
|
|
|
|
const StatusCell = (props: IStatusCellProps): JSX.Element => {
|
|
const { value } = props;
|
|
|
|
const statusClassName = classnames(
|
|
"data-table__status",
|
|
`data-table__status--${generateClassTag(value)}`
|
|
);
|
|
|
|
return <span className={statusClassName}>{value}</span>;
|
|
};
|
|
|
|
export default StatusCell;
|