-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcomponent_details.tsx
43 lines (39 loc) · 1.25 KB
/
component_details.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react';
import { EuiPanel } from '@elastic/eui';
import { ReactFlowComponent, Workflow } from '../../../../common';
import { ComponentInputs } from './component_inputs';
import { EmptyComponentInputs } from './empty_component_inputs';
import { ProvisionedComponentInputs } from './provisioned_component_inputs';
// styling
import '../workspace/workspace-styles.scss';
interface ComponentDetailsProps {
workflow: Workflow | undefined;
onFormChange: () => void;
isDeprovisionable: boolean;
selectedComponent?: ReactFlowComponent;
}
/**
* A panel that will be nested in a resizable container to dynamically show
* the details and user-required inputs based on the selected component
* in the flow workspace.
*/
export function ComponentDetails(props: ComponentDetailsProps) {
return (
<EuiPanel paddingSize="m">
{props.isDeprovisionable ? (
<ProvisionedComponentInputs />
) : props.selectedComponent ? (
<ComponentInputs
selectedComponent={props.selectedComponent}
onFormChange={props.onFormChange}
/>
) : props.workflow ? (
<EmptyComponentInputs />
) : undefined}
</EuiPanel>
);
}