+// ToDo: share onClick
+export const resourceShare = (uuidPrefix: string, ownerUuid?: string) => {
+ const isPublic = ownerUuid === getPublicUuid(uuidPrefix);
+ return (
+ <div>
+ { isPublic &&
+ <Tooltip title="Share">
+ <IconButton onClick={() => undefined}>
+ <ShareIcon />
+ </IconButton>
+ </Tooltip>
+ }
+ </div>
+ );
+};
+
+export const ResourceShare = connect(
+ (state: RootState, props: { uuid: string }) => {
+ const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
+ const uuidPrefix = getUuidPrefix(state);
+ return {
+ ownerUuid: resource ? resource.ownerUuid : '',
+ uuidPrefix
+ };
+ })((props: { ownerUuid?: string, uuidPrefix: string }) => resourceShare(props.uuidPrefix, props.ownerUuid));
+
+export const renderWorkflowStatus = (uuidPrefix: string, ownerUuid?: string) => {
+ if (ownerUuid === getPublicUuid(uuidPrefix)) {
+ return renderStatus(ResourceStatus.PUBLIC);
+ } else {
+ return renderStatus(ResourceStatus.PRIVATE);
+ }
+};
+
+const renderStatus = (status: string) =>
+ <Typography noWrap style={{ width: '60px' }}>{status}</Typography>;
+
+export const ResourceWorkflowStatus = connect(
+ (state: RootState, props: { uuid: string }) => {
+ const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
+ const uuidPrefix = getUuidPrefix(state);
+ return {
+ ownerUuid: resource ? resource.ownerUuid : '',
+ uuidPrefix
+ };
+ })((props: { ownerUuid?: string, uuidPrefix: string }) => renderWorkflowStatus(props.uuidPrefix, props.ownerUuid));
+