import * as React from "react"; import * as Actions from "~/common/actions"; import * as Window from "~/common/window"; import * as Constants from "~/common/constants"; import * as System from "~/components/system"; import * as Events from "~/common/custom-events"; import * as SVG from "~/common/svg"; import { css } from "@emotion/react"; import { SecondaryTabGroup } from "~/components/core/TabGroup"; import { ConfirmationModal } from "~/components/core/ConfirmationModal"; import ScenePage from "~/components/core/ScenePage"; import ScenePageHeader from "~/components/core/ScenePageHeader"; import SquareButtonGray from "~/components/core/SquareButtonGray"; import APIDocsGetV1 from "~/components/api-docs/v1/get"; import APIDocsGetSlateV1 from "~/components/api-docs/v1/get-slate.js"; import APIDocsUpdateSlateV1 from "~/components/api-docs/v1/update-slate.js"; import APIDocsUploadToSlateV1 from "~/components/api-docs/v1/upload.js"; import APIDocsGetV2 from "~/components/api-docs/v2/get"; import APIDocsGetSlateV2 from "~/components/api-docs/v2/get-slate.js"; import APIDocsUpdateSlateV2 from "~/components/api-docs/v2/update-slate.js"; import APIDocsUpdateFileV2 from "~/components/api-docs/v2/update-file.js"; import APIDocsUploadToSlateV2 from "~/components/api-docs/v2/upload.js"; import APIDocsCreateLinkV2 from "~/components/api-docs/v2/create-link.js"; import APIDocsCreateCollectionV2 from "~/components/api-docs/v2/create-collection.js"; import APIDocsUploadByCidV2 from "~/components/api-docs/v2/upload-by-cid.js"; import APIDocsUploadByUrlV2 from "~/components/api-docs/v2/upload-by-url.js"; import APIDocsGetV3 from "~/components/api-docs/v3/get"; import APIDocsGetSlateV3 from "~/components/api-docs/v3/get-slate.js"; import APIDocsUpdateSlateV3 from "~/components/api-docs/v3/update-slate.js"; import APIDocsUpdateFileV3 from "~/components/api-docs/v3/update-file.js"; import APIDocsUploadToSlateV3 from "~/components/api-docs/v3/upload.js"; import APIDocsCreateLinkV3 from "~/components/api-docs/v3/create-link.js"; import APIDocsCreateCollectionV3 from "~/components/api-docs/v3/create-collection.js"; import APIDocsUploadByCidV3 from "~/components/api-docs/v3/upload-by-cid.js"; import APIDocsUploadByUrlV3 from "~/components/api-docs/v3/upload-by-url.js"; import WebsitePrototypeWrapper from "~/components/core/WebsitePrototypeWrapper"; const STYLES_API_KEY = css` height: 40px; border-radius: 4px; cursor: copy; background-color: ${Constants.semantic.bgLight}; outline: none; border: none; width: 100%; max-width: 380px; font-family: ${Constants.font.code}; padding: 0 16px; font-size: 14px; `; const STYLES_KEY_CONTAINER = css` height: 40px; display: flex; flex-direction: row; align-items: center; margin-bottom: 8px; `; const STYLES_EXAMPLE = css` margin-bottom: 48px; `; const STYLES_SECTION_HEADER = css` margin-top: 48px; margin-bottom: 24px; `; class Key extends React.Component { _input; state = { visible: false, copying: false, modalShow: false }; _handleDelete = async (res, id) => { if (!res) { this.setState({ modalShow: false }); return; } await this.props.onDelete(id); this.setState({ modalShow: false }); }; _handleCopy = async () => { this._input.select(); document.execCommand("copy"); await this.setState({ copying: true }); await Window.delay(1000); await this.setState({ copying: false }); }; render() { return (