mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-24 01:18:01 +02:00
24 lines
705 B
TypeScript
24 lines
705 B
TypeScript
import { VFC } from 'react';
|
|
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
|
|
import { resolveChangeRequestStatusIcon } from 'component/changeRequest/changeRequest.utils';
|
|
import { ChangeRequestState } from 'component/changeRequest/changeRequest.types';
|
|
|
|
interface IChangeRequestStatusCellProps {
|
|
value?: string | null;
|
|
}
|
|
|
|
export const ChangeRequestStatusCell: VFC<IChangeRequestStatusCellProps> = ({
|
|
value,
|
|
}) => {
|
|
const renderState = () => {
|
|
if (!value) return null;
|
|
return resolveChangeRequestStatusIcon(value as ChangeRequestState);
|
|
};
|
|
|
|
if (!value) {
|
|
return <TextCell />;
|
|
}
|
|
|
|
return <TextCell>{renderState()}</TextCell>;
|
|
};
|