2021-12-22 14:59:07 +01:00
|
|
|
import { Button } from '@chakra-ui/react'
|
2021-12-23 16:31:56 +01:00
|
|
|
import { useTypebot } from 'contexts/TypebotContext'
|
2021-12-22 14:59:07 +01:00
|
|
|
|
|
|
|
export const PublishButton = () => {
|
2021-12-23 16:31:56 +01:00
|
|
|
const { isPublishing, isPublished, publishTypebot } = useTypebot()
|
|
|
|
|
2021-12-22 14:59:07 +01:00
|
|
|
return (
|
2021-12-23 16:31:56 +01:00
|
|
|
<Button
|
|
|
|
ml={2}
|
|
|
|
colorScheme="blue"
|
|
|
|
isLoading={isPublishing}
|
|
|
|
isDisabled={isPublished}
|
|
|
|
onClick={publishTypebot}
|
|
|
|
>
|
|
|
|
{isPublished ? 'Published' : 'Publish'}
|
2021-12-22 14:59:07 +01:00
|
|
|
</Button>
|
|
|
|
)
|
|
|
|
}
|