import * as React from "react";
import * as Constants from "~/common/constants";
import * as Strings from "~/common/strings";
import * as System from "~/components/system";
import * as Actions from "~/common/actions";
import { css } from "@emotion/react";
import Section from "~/components/core/Section";
import MediaObject from "~/components/core/MediaObject";
const COLUMNS_SCHEMA = [
{ key: "cid", name: "CID", width: "100%" },
{
key: "size",
name: "Size",
width: "84px",
},
{ key: "type", name: "Type", type: "TEXT_TAG", width: "172px" },
{
key: "networks",
name: "Networks",
type: "NETWORK_TYPE",
},
{
key: "storage",
name: "Storage Deal Status",
width: "148px",
type: "STORAGE_DEAL_STATUS",
},
];
const STYLES_LINK = css`
font-family: ${Constants.font.semiBold};
font-weight: 400;
cursor: pointer;
transition: 200ms ease all;
:hover {
color: ${Constants.system.brand};
}
`;
const STYLES_LABEL = css`
letter-spacing: 0.1px;
font-size: 12px;
text-transform: uppercase;
font-family: ${Constants.font.semiBold};
font-weight: 400;
color: ${Constants.system.black};
`;
const STYLES_SECTION = css`
margin: 12px 0 16px 0;
`;
const delay = (ms) => new Promise((resolve) => window.setTimeout(resolve, ms));
export default class DataView extends React.Component {
state = {
selectedRowId: null,
};
async componentDidMount() {
await this._handleUpdate();
}
_handleUpdate = async () => {
// NOTE(jim): Hack to handle some race conditions.
await delay(200);
System.dispatchCustomEvent({
name: "slate-global-create-carousel",
detail: {
slides: this.props.items.map((each) => {
const cid = each.ipfs.replace("/ipfs/", "");
return {
id: each.id,
cid,
component: