2020-06-19 06:57:57 +03:00
|
|
|
import * as React from "react";
|
2020-07-24 10:45:21 +03:00
|
|
|
import * as Actions from "~/common/actions";
|
2020-06-19 06:57:57 +03:00
|
|
|
import * as System from "~/components/system";
|
2020-09-08 00:45:58 +03:00
|
|
|
import * as SVG from "~/common/svg";
|
|
|
|
import * as Constants from "~/common/constants";
|
2020-04-09 00:29:13 +03:00
|
|
|
|
2020-06-19 06:57:57 +03:00
|
|
|
import { css } from "@emotion/react";
|
2020-09-08 00:45:58 +03:00
|
|
|
import { TabGroup } from "~/components/core/TabGroup";
|
2020-09-19 22:36:58 +03:00
|
|
|
import { ButtonPrimary } from "~/components/system/components/Buttons";
|
2020-09-18 06:40:10 +03:00
|
|
|
import { dispatchCustomEvent } from "~/common/custom-events";
|
2020-09-25 09:31:56 +03:00
|
|
|
import { WarningMessage } from "~/components/core/WarningMessage";
|
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-08-08 03:22:45 +03:00
|
|
|
import DataMeter from "~/components/core/DataMeter";
|
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-09-14 08:22:19 +03:00
|
|
|
const STYLES_ICONS = css`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: center;
|
|
|
|
`;
|
|
|
|
|
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 {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<ScenePage>
|
2020-09-08 00:45:58 +03:00
|
|
|
<ScenePageHeader
|
|
|
|
title="Data"
|
|
|
|
actions={
|
|
|
|
<ButtonPrimary
|
|
|
|
onClick={() => {
|
|
|
|
this.props.onAction({
|
|
|
|
type: "SIDEBAR",
|
|
|
|
value: "SIDEBAR_ADD_FILE_TO_BUCKET",
|
|
|
|
});
|
|
|
|
}}
|
|
|
|
>
|
2020-09-13 03:00:58 +03:00
|
|
|
Upload data
|
2020-09-08 00:45:58 +03:00
|
|
|
</ButtonPrimary>
|
|
|
|
}
|
2020-08-12 11:22:28 +03:00
|
|
|
/>
|
2020-09-25 08:32:56 +03:00
|
|
|
|
2020-09-08 00:45:58 +03:00
|
|
|
<TabGroup disabled tabs={["Usage"]} />
|
2020-09-08 01:16:02 +03:00
|
|
|
<DataMeter
|
|
|
|
stats={this.props.viewer.stats}
|
|
|
|
style={{ margin: "48px 0 48px 0" }}
|
|
|
|
/>
|
2020-09-14 23:42:52 +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}
|
|
|
|
onRehydrate={this.props.onRehydrate}
|
|
|
|
/>
|
2020-09-14 08:22:19 +03:00
|
|
|
) : (
|
|
|
|
<EmptyState>
|
|
|
|
<div css={STYLES_ICONS}>
|
|
|
|
<SVG.Sound height="24px" style={{ margin: "0 16px" }} />
|
|
|
|
<SVG.Document height="24px" style={{ margin: "0 16px" }} />
|
|
|
|
<SVG.Image height="24px" style={{ margin: "0 16px" }} />
|
|
|
|
<SVG.Book height="24px" style={{ margin: "0 16px" }} />
|
|
|
|
<SVG.Video height="24px" style={{ margin: "0 16px" }} />
|
|
|
|
</div>
|
|
|
|
<div style={{ marginTop: 24 }}>
|
|
|
|
Drag and drop files into Slate to upload
|
|
|
|
</div>
|
|
|
|
</EmptyState>
|
|
|
|
)}
|
2020-04-09 00:29:13 +03:00
|
|
|
</ScenePage>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|