import { CopyToClipboard } from "react-copy-to-clipboard"; import { Flex } from "reflexbox/styled-components"; import React, { FC, useState } from "react"; import styled from "styled-components"; import { useStoreState, useStoreActions } from "../../store"; import { Button } from "../Button"; import ALink from "../ALink"; import Icon from "../Icon"; import Text, { H2 } from "../Text"; import { Col } from "../Layout"; const ApiKey = styled(Text).attrs({ mr: 3, fontSize: [14, 16], fontWeight: 700 })` max-width: 100%; border-bottom: 2px dotted #999; `; const SettingsApi: FC = () => { const [copied, setCopied] = useState(false); const [loading, setLoading] = useState(false); const apikey = useStoreState(s => s.settings.apikey); const generateApiKey = useStoreActions(s => s.settings.generateApiKey); const onCopy = () => { setCopied(true); setTimeout(() => { setCopied(false); }, 1500); }; const onSubmit = async () => { if (loading) return; setLoading(true); await generateApiKey(); setLoading(false); }; return (

API

In additional to this website, you can use the API to create, delete and get shortend URLs. If {" you're"} not familiar with API, {"don't"} generate the key. DO NOT share this key on the client side of your website.{" "} Read API docs. {apikey && ( {copied && ( Copied to clipboard. )} {apikey} )} ); }; export default SettingsApi;