2020-06-19 06:57:57 +03:00
|
|
|
import * as React from "react";
|
2020-09-08 00:45:58 +03:00
|
|
|
import * as SVG from "~/common/svg";
|
2020-04-09 00:29:13 +03:00
|
|
|
|
2020-09-19 22:36:58 +03:00
|
|
|
import { ButtonPrimary } from "~/components/system/components/Buttons";
|
2020-11-11 04:44:21 +03:00
|
|
|
import { FileTypeGroup } from "~/components/core/FileTypeIcon";
|
2020-12-18 00:49:39 +03:00
|
|
|
import { PrimaryTabGroup, SecondaryTabGroup } from "~/components/core/TabGroup";
|
2020-04-09 00:29:13 +03:00
|
|
|
|
2020-06-19 06:57:57 +03:00
|
|
|
import ScenePage from "~/components/core/ScenePage";
|
2020-08-12 11:22:28 +03:00
|
|
|
import DataView from "~/components/core/DataView";
|
2020-11-04 07:02:19 +03:00
|
|
|
import DataMeter from "~/components/core/DataMeterDetailed";
|
2020-08-22 07:25:34 +03:00
|
|
|
import ScenePageHeader from "~/components/core/ScenePageHeader";
|
2020-09-14 08:22:19 +03:00
|
|
|
import EmptyState from "~/components/core/EmptyState";
|
2020-09-08 00:45:58 +03:00
|
|
|
|
2020-07-24 19:35:00 +03:00
|
|
|
const POLLING_INTERVAL = 10000;
|
|
|
|
|
2020-04-09 00:29:13 +03:00
|
|
|
export default class SceneFilesFolder extends React.Component {
|
2020-12-18 00:49:39 +03:00
|
|
|
state = {
|
|
|
|
view: 0,
|
|
|
|
};
|
|
|
|
|
2020-04-09 00:29:13 +03:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<ScenePage>
|
2020-09-08 00:45:58 +03:00
|
|
|
<ScenePageHeader
|
2020-12-18 00:49:39 +03:00
|
|
|
title={
|
|
|
|
<PrimaryTabGroup
|
2020-12-19 08:25:50 +03:00
|
|
|
tabs={[
|
|
|
|
{ title: "Files", value: "NAV_DATA" },
|
|
|
|
{ title: "Slates", value: "NAV_SLATES" },
|
|
|
|
{ title: "Activity", value: "NAV_ACTIVITY" },
|
|
|
|
]}
|
|
|
|
value={0}
|
|
|
|
onAction={this.props.onAction}
|
2020-12-18 00:49:39 +03:00
|
|
|
/>
|
|
|
|
}
|
|
|
|
actions={
|
|
|
|
<SecondaryTabGroup
|
|
|
|
tabs={[
|
|
|
|
<SVG.GridView height="24px" style={{ display: "block" }} />,
|
|
|
|
<SVG.TableView height="24px" style={{ display: "block" }} />,
|
|
|
|
]}
|
|
|
|
value={this.state.view}
|
|
|
|
onChange={(value) => this.setState({ view: value })}
|
|
|
|
style={{ margin: "0 0 24px 0" }}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
/>
|
2020-12-20 06:25:28 +03:00
|
|
|
<DataMeter
|
|
|
|
stats={this.props.viewer.stats}
|
|
|
|
style={{ marginBottom: 64 }}
|
|
|
|
buttons={
|
2020-09-08 00:45:58 +03:00
|
|
|
<ButtonPrimary
|
|
|
|
onClick={() => {
|
|
|
|
this.props.onAction({
|
|
|
|
type: "SIDEBAR",
|
|
|
|
value: "SIDEBAR_ADD_FILE_TO_BUCKET",
|
|
|
|
});
|
|
|
|
}}
|
2020-12-20 06:25:28 +03:00
|
|
|
style={{ whiteSpace: "nowrap", marginRight: 24 }}
|
2020-09-08 00:45:58 +03:00
|
|
|
>
|
2020-09-13 03:00:58 +03:00
|
|
|
Upload data
|
2020-09-08 00:45:58 +03:00
|
|
|
</ButtonPrimary>
|
|
|
|
}
|
2020-12-20 06:25:28 +03:00
|
|
|
/>
|
2020-10-22 08:06:06 +03:00
|
|
|
{this.props.viewer.library[0].children && this.props.viewer.library[0].children.length ? (
|
2020-09-19 22:36:58 +03:00
|
|
|
<DataView
|
2020-09-23 23:52:00 +03:00
|
|
|
onAction={this.props.onAction}
|
2020-09-19 22:36:58 +03:00
|
|
|
viewer={this.props.viewer}
|
|
|
|
items={this.props.viewer.library[0].children}
|
2020-12-15 04:43:16 +03:00
|
|
|
onUpdateViewer={this.props.onUpdateViewer}
|
2020-12-18 00:49:39 +03:00
|
|
|
view={this.state.view}
|
2020-09-19 22:36:58 +03:00
|
|
|
/>
|
2020-09-14 08:22:19 +03:00
|
|
|
) : (
|
|
|
|
<EmptyState>
|
2020-11-11 04:44:21 +03:00
|
|
|
<FileTypeGroup />
|
2020-10-22 08:06:06 +03:00
|
|
|
<div style={{ marginTop: 24 }}>Drag and drop files into Slate to upload</div>
|
2020-09-14 08:22:19 +03:00
|
|
|
</EmptyState>
|
|
|
|
)}
|
2020-04-09 00:29:13 +03:00
|
|
|
</ScenePage>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|