import * as React from "react"; import * as SVG from "~/common/svg"; import * as Events from "~/common/custom-events"; import { ButtonPrimary } from "~/components/system/components/Buttons"; import { FileTypeGroup } from "~/components/core/FileTypeIcon"; import { TabGroup, PrimaryTabGroup, SecondaryTabGroup } from "~/components/core/TabGroup"; import { GlobalCarousel } from "~/components/system/components/GlobalCarousel"; import ScenePage from "~/components/core/ScenePage"; import DataView from "~/components/core/DataView"; import DataMeter from "~/components/core/DataMeterDetailed"; import ScenePageHeader from "~/components/core/ScenePageHeader"; import EmptyState from "~/components/core/EmptyState"; const POLLING_INTERVAL = 10000; export default class SceneFilesFolder extends React.Component { state = { view: 0, }; componentDidMount = () => { let index = -1; let page = this.props.page; if (page?.fileId || page?.cid || page?.index) { if (page?.index) { index = page.index; } else { let library = this.props.viewer.library[0]?.children || []; for (let i = 0; i < library.length; i++) { let obj = library[i]; if ((obj.cid && obj.cid === page?.cid) || (obj.id && obj.id === page?.fileId)) { index = i; break; } } } } if (index !== -1) { Events.dispatchCustomEvent({ name: "slate-global-open-carousel", detail: { index }, }); } }; render() { return ( this.setState({ tab: value })} style={{ marginTop: 0, marginBottom: 32 }} itemStyle={{ margin: "0px 12px" }} /> ) : ( ) } actions={ this.props.mobile ? null : ( , , ]} value={this.state.view} onChange={(value) => this.setState({ view: value })} style={{ margin: "0 0 24px 0" }} /> ) } /> { this.props.onAction({ type: "SIDEBAR", value: "SIDEBAR_ADD_FILE_TO_BUCKET", }); }} style={{ whiteSpace: "nowrap", marginRight: 24 }} > Upload data } /> {this.props.viewer.library[0].children && this.props.viewer.library[0].children.length ? ( ) : (
Drag and drop files into Slate to upload
)}
); } }