import { useState } from 'react' import { useTranslation } from 'next-i18next' import Popout from 'shared/components/popout' import WebLink from 'shared/components/web-link' import {exportTypes, handleExport} from './export-handler' const ExportDraft = ({ gist, design, app }) => { const [link, setLink] = useState(false) const [error, setError] = useState(false) const [format, setFormat] = useState(false) const { t } = useTranslation(['app']) const doExport = (format) => { setLink(false) setError(false) setFormat(format) handleExport(format, gist, design, t, app, (e) => { if (e.data.link) {setLink(e.data.link)} }, (e) => { if (e.data.error) {setError(true)} }) } return (
{t('exportPattern-txt')}
{link && (