import React , { FC } from 'react' ; import { analytics } from '../config/firebase' ; import { useSnippetState } from '../context' ; import { Button , useDisclosure } from './core' ; import { ExportModal } from './ExportModal' ; type ExportMenuProps = { snippetID ? : string ; isLoading ? : boolean ; isDisabled ? : boolean ; } ; export const ExportMenu = ( ) => { const { isOpen , onClose , onOpen } = useDisclosure ( ) ; const { steps , tags , defaultLanguage } = useSnippetState ( ) ; return ( < > { } { } < Button isDisabled = { steps . length <= 1 } onClick = { ( ) => { analytics . logEvent ( 'snippet_export_modal_opened' , { language : defaultLanguage , numberOfSteps : steps . length , snippetTags : tags , } ) ; onOpen ( ) ; } } > Export < /Button> < ExportModal isOpen = { isOpen } onClose = { onClose } / > < />); } ;