// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; import { StyleRulesCallback, withStyles, Grid, Button, WithStyles, List, ListItem, ListItemText, ListItemIcon } from '@material-ui/core'; import { ArvadosTheme } from '~/common/custom-theme'; import { WorkflowResource } from '~/models/workflow'; import { WorkflowIcon } from '~/components/icon/icon'; import { WorkflowDetailsCard } from '~/views/workflow-panel/workflow-description-card'; import { SearchInput } from '~/components/search-input/search-input'; type CssRules = 'root' | 'searchGrid' | 'workflowDetailsGrid' | 'list' | 'listItem' | 'itemSelected' | 'listItemText' | 'listItemIcon'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { alignSelf: 'flex-start' }, searchGrid: { marginBottom: theme.spacing.unit * 2 }, workflowDetailsGrid: { borderLeft: `1px solid ${theme.palette.grey["300"]}` }, list: { maxHeight: 300, position: 'relative', overflow: 'auto' }, listItem: { padding: theme.spacing.unit, }, itemSelected: { backgroundColor: 'rgba(3, 190, 171, 0.3) !important' }, listItemText: { fontSize: '0.875rem' }, listItemIcon: { color: theme.customs.colors.red900 } }); export interface RunProcessFirstStepDataProps { workflows: WorkflowResource[]; selectedWorkflow: WorkflowResource | undefined; } export interface RunProcessFirstStepActionProps { onSearch: (term: string) => void; onSetStep: (step: number) => void; onSetWorkflow: (workflow: WorkflowResource) => void; } type RunProcessFirstStepProps = RunProcessFirstStepDataProps & RunProcessFirstStepActionProps & WithStyles; export const RunProcessFirstStep = withStyles(styles)( ({ onSearch, onSetStep, onSetWorkflow, workflows, selectedWorkflow, classes }: RunProcessFirstStepProps) => {workflows.map(workflow => ( onSetWorkflow(workflow)}> ))} );