import { Button, HStack, IconButton, Stack, Tooltip, Text, Menu, MenuButton, MenuList, MenuItem, } from '@chakra-ui/react' import { ChevronLeftIcon } from 'assets/icons' import { useTypebot } from 'contexts/TypebotContext/TypebotContext' import { timeSince } from 'services/utils' import { isNotDefined } from 'utils' export const PublishButton = () => { const { isPublishing, isPublished, publishTypebot, publishedTypebot, restorePublishedTypebot, } = useTypebot() return ( There are non published changes. Published version from{' '} {publishedTypebot && timeSince(publishedTypebot.updatedAt.toString())}{' '} ago } isDisabled={isNotDefined(publishedTypebot)} > {publishedTypebot && !isPublished && ( } aria-label="Show published version" /> Restore published version )} ) }