// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { Select, FormControl, InputLabel, MenuItem, Tooltip } from '@mui/material'; import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { CustomStyleRulesCallback } from 'common/custom-theme'; 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'; const styles: CustomStyleRulesCallback = theme => ({ root: { display: 'flex', }, icon: { color: 'rgba(0, 0, 0, 0.38)', marginTop: 18, marginLeft: 8, }, }); export const WorkflowPresetSelect = withStyles(styles)( 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); } } });