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"; import { useCopy } from "../../hooks"; import Animation from "../Animation"; import { Colors } from "../../consts"; const ApiKey = styled(Text).attrs({ mt: "2px", fontSize: [15, 16], bold: true })` border-bottom: 1px dotted ${Colors.StatsTotalUnderline}; cursor: pointer; :hover { opacity: 0.8; } `; const SettingsApi: FC = () => { const [copied, setCopied] = useCopy(); const [loading, setLoading] = useState(false); const apikey = useStoreState(s => s.settings.apikey); const generateApiKey = useStoreActions(s => s.settings.generateApiKey); const onSubmit = async () => { if (loading) return; setLoading(true); await generateApiKey(); setLoading(false); }; return (