import { Button, Classes, Popover, Position, Switch, Tab, Tabs } from '@blueprintjs/core'; import { Column } from './Boxes'; import * as React from 'react'; import styled from '@emotion/styled'; import { IconNames } from '@blueprintjs/icons'; import { useLocation } from 'react-router-dom'; import { FC, useState } from 'react'; const Outer = styled(Column)` padding: 10px 20px 10px 20px; font-size: 12px; `; const StyledTextArea = styled.textarea<{ multiline?: boolean }>( props => ` @media (min-width: 500px) { width: 30em; } width: 18em; min-height: ${props.multiline ? '10em;' : '6em'}; overflow: hidden; font-family: monospace; ` ); const Group = styled.div` position: relative; `; const CopyButton = styled(Button)` position: absolute; top: 10px; right: 10px; `; const CopyInput: FC<{ text: string; embed?: boolean }> = ({ text, embed }) => { const textAreaRef = React.useRef(null); const handleCopyToClipboard = () => { const input = textAreaRef.current; if (input) { input.select(); document.execCommand('copy'); } }; return ( ); }; const SharePopover: React.FC<{}> = ({ children }) => { const location = useLocation(); const [selectedTab, setSelectedTab] = useState('url'); const [withState, setWithState] = useState(false); return ( setSelectedTab(`${newTabId}`)}> } /> ` } /> } /> setWithState(!withState)} label="Current view of the map" /> } > {children} ); }; export default SharePopover;