import React from 'react'
import enhanceWithClickOutside from 'react-click-outside'
import { withRouter } from 'next/router'
import { COLORS, EXPORT_SIZES } from '../lib/constants'
import Button from './Button'
import CopyButton from './CopyButton'
import WindowPointer from './WindowPointer'
import { toggle } from '../lib/util'
const toIFrame = url =>
`
`
const CopyEmbed = withRouter(
React.memo(
({ router: { asPath } }) => (
{({ copied }) => (
)}
),
(prevProps, nextProps) => prevProps.router.asPath === nextProps.router.asPath
)
)
class ExportMenu extends React.PureComponent {
state = {
isVisible: false
}
toggle = () => this.setState(toggle('isVisible'))
handleClickOutside = () => this.setState({ isVisible: false })
handleInputChange = e => this.props.onChange(e.target.name, e.target.value)
handleExportSizeChange = selectedSize => () => this.props.onChange('exportSize', selectedSize)
handleExport = format => () => this.props.export(format)
render() {
const { exportSize, filename } = this.props
const { isVisible } = this.state
return (
)
}
}
export default enhanceWithClickOutside(ExportMenu)