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