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 DATALAYER_INSTANCE_TYPE = "DataLayerComponent";
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export interface IDataLayerArgs {
|
14 |
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export interface IDataLayerProps {
|
21 |
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export function isDataLayer(component) {
|
31 | return component !== undefined &&
|
32 | component.instanceType === DATALAYER_INSTANCE_TYPE
|
33 | }
|
34 |
|
35 |
|
36 |
|
37 | export default (props: IDataLayerArgs | any) => {
|
38 |
|
39 | const componentProps: IInfrastructure & IComponent = {
|
40 | infrastructureType: Types.INFRASTRUCTURE_TYPE_COMPONENT,
|
41 | instanceType: DATALAYER_INSTANCE_TYPE,
|
42 | instanceId: "props.name"
|
43 | };
|
44 |
|
45 | const datalayerProps: IDataLayerProps = {
|
46 |
|
47 | }
|
48 |
|
49 | return Object.assign(props, componentProps, datalayerProps);
|
50 |
|
51 |
|
52 | }; |
\ | No newline at end of file |