feat(editor): ✨ Restore published version button
Had to migrate webhooks into a standalone table
This commit is contained in:
@ -1,11 +1,16 @@
|
||||
import { Text } from '@chakra-ui/react'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { WebhookStep } from 'models'
|
||||
import { byId } from 'utils'
|
||||
|
||||
type Props = {
|
||||
step: WebhookStep
|
||||
}
|
||||
|
||||
export const WebhookContent = ({ step: { webhook } }: Props) => {
|
||||
export const WebhookContent = ({ step: { webhookId } }: Props) => {
|
||||
const { webhooks } = useTypebot()
|
||||
const webhook = webhooks.find(byId(webhookId))
|
||||
|
||||
if (!webhook?.url) return <Text color="gray.500">Configure...</Text>
|
||||
return (
|
||||
<Text isTruncated pr="6">
|
||||
|
@ -1,17 +1,21 @@
|
||||
import { Text } from '@chakra-ui/react'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { ZapierStep } from 'models'
|
||||
import { isNotDefined } from 'utils'
|
||||
import { byId, isNotDefined } from 'utils'
|
||||
|
||||
type Props = {
|
||||
step: ZapierStep
|
||||
}
|
||||
|
||||
export const ZapierContent = ({ step }: Props) => {
|
||||
if (isNotDefined(step.webhook.body))
|
||||
export const ZapierContent = ({ step: { webhookId } }: Props) => {
|
||||
const { webhooks } = useTypebot()
|
||||
const webhook = webhooks.find(byId(webhookId))
|
||||
|
||||
if (isNotDefined(webhook?.body))
|
||||
return <Text color="gray.500">Configure...</Text>
|
||||
return (
|
||||
<Text isTruncated pr="6">
|
||||
{step.webhook.url ? 'Enabled' : 'Disabled'}
|
||||
{webhook?.url ? 'Enabled' : 'Disabled'}
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user