forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
42 lines (38 loc) · 1.06 KB
/
index.js
File metadata and controls
42 lines (38 loc) · 1.06 KB
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
// @flow
import * as React from 'react';
import { EntryContainer as Entry } from 'app/pages/Sandbox/Editor/Workspace/elements';
import EntryIcons from 'app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry/EntryIcons';
import EntryTitle from 'app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry/EntryTitle';
import { LeftOffset } from './elements';
type Props = {
title: string,
depth: number,
type: string,
active?: boolean,
alternative?: boolean,
onClick?: () => void,
};
export default class File extends React.PureComponent<Props> {
static defaultProps = {
active: false,
alternative: false,
};
render() {
const { title, depth, type, active, alternative, onClick } = this.props;
return (
<div>
<Entry
alternative={alternative}
active={active}
type={type}
onClick={onClick}
>
<LeftOffset depth={depth}>
<EntryIcons type={type} />
<EntryTitle title={title} />
</LeftOffset>
</Entry>
</div>
);
}
}