-export const renderStatus = (item: { status?: string }) =>
- <Typography noWrap align="center" >
- {item.status || "-"}
- </Typography>;
-
-export const ProcessStatus = connect(
- (state: RootState, props: { uuid: string }) => {
- const resource = getResource<ProcessResource>(props.uuid)(state.resources);
- return { status: resource ? resource.state : '-' };
- })((props: { status: string }) => renderType(props.status));
+export const ProcessStatus = compose(
+ connect((state: RootState, props: { uuid: string }) => {
+ return { process: getProcess(props.uuid)(state.resources) };
+ }),
+ withStyles({}, { withTheme: true }))
+ ((props: { process?: Process, theme: ArvadosTheme }) => {
+ const status = props.process ? getProcessStatus(props.process) : "-";
+ return <Typography
+ noWrap
+ align="center"
+ style={{ color: getProcessStatusColor(status, props.theme) }} >
+ {status}
+ </Typography>;
+ });