slate/scenes/SceneFilesFolder.js

64 lines
2.0 KiB
JavaScript
Raw Normal View History

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";
import { css } from "@emotion/core";
import { ButtonPrimary } from "~/components/system/components/Buttons";
2020-06-19 06:57:57 +03:00
import ScenePage from "~/components/core/ScenePage";
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";
import EmptyState from "~/components/core/EmptyState";
2020-09-08 00:45:58 +03:00
const STYLES_ICONS = css`
display: flex;
flex-direction: row;
justify-content: center;
`;
const POLLING_INTERVAL = 10000;
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",
});
}}
>
Upload data
2020-09-08 00:45:58 +03:00
</ButtonPrimary>
}
/>
2020-09-25 08:32:56 +03:00
2020-10-22 08:06:06 +03:00
<DataMeter stats={this.props.viewer.stats} style={{ marginTop: 40 }} />
{this.props.viewer.library[0].children && this.props.viewer.library[0].children.length ? (
<DataView
2020-09-23 23:52:00 +03:00
onAction={this.props.onAction}
viewer={this.props.viewer}
items={this.props.viewer.library[0].children}
/>
) : (
<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>
2020-10-22 08:06:06 +03:00
<div style={{ marginTop: 24 }}>Drag and drop files into Slate to upload</div>
</EmptyState>
)}
</ScenePage>
);
}
}