1 | import * as React from 'react';
|
2 |
|
3 | import Types from '../types';
|
4 | import { IComponent } from "../types/component";
|
5 | import { IInfrastructure } from "../types";
|
6 |
|
7 | export const ENVVALUE_INSTANCE_TYPE = "EnvValueComponent";
|
8 |
|
9 |
|
10 | export interface IEnvValueArgs {
|
11 | |
12 |
|
13 |
|
14 | name: string,
|
15 |
|
16 | |
17 |
|
18 |
|
19 | value: any
|
20 | }
|
21 |
|
22 | export interface IEnvValueProps {
|
23 |
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export function isEnvValue(component) {
|
33 | return component !== undefined &&
|
34 | component.instanceType === ENVVALUE_INSTANCE_TYPE
|
35 | }
|
36 |
|
37 |
|
38 |
|
39 | export default (props: IEnvValueArgs | any) => {
|
40 |
|
41 | const componentProps: IInfrastructure & IComponent = {
|
42 | infrastructureType: Types.INFRASTRUCTURE_TYPE_COMPONENT,
|
43 | instanceType: ENVVALUE_INSTANCE_TYPE,
|
44 | instanceId: props.name
|
45 | };
|
46 |
|
47 | const environmentProps: IEnvValueProps = {
|
48 |
|
49 | }
|
50 |
|
51 | return Object.assign(props, componentProps, environmentProps);
|
52 |
|
53 |
|
54 | }; |
\ | No newline at end of file |