// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { Select, FormControl, InputLabel, MenuItem, Tooltip, withStyles, WithStyles } from '@material-ui/core'; import { WorkflowResource } from 'models/workflow'; import { DetailsIcon } from 'components/icon/icon'; export interface WorkflowPresetSelectProps { workflow: WorkflowResource; selectedPreset: WorkflowResource; presets: WorkflowResource[]; onChange: (preset: WorkflowResource) => void; } type CssRules = 'root' | 'icon'; export const WorkflowPresetSelect = withStyles(theme => ({ root: { display: 'flex', }, icon: { color: theme.palette.text.hint, marginTop: 18, marginLeft: 8, }, }))( class extends React.Component> { render() { const { selectedPreset, workflow, presets, classes } = this.props; return (
Preset
); } handleChange = ({ target }: React.ChangeEvent) => { const { workflow, presets, onChange } = this.props; const selectedPreset = [workflow, ...presets] .find(({ uuid }) => uuid === target.value); if (selectedPreset) { onChange(selectedPreset); } } });