2
0

feat(editor): Add Zapier step

This commit is contained in:
Baptiste Arnaud
2022-02-22 08:03:38 +01:00
parent d0994e6577
commit 642a42779b
15 changed files with 117 additions and 13 deletions

View File

@ -36,6 +36,7 @@ import { RedirectSettings } from './bodies/RedirectSettings'
import { SendEmailSettings } from './bodies/SendEmailSettings/SendEmailSettings'
import { SetVariableSettings } from './bodies/SetVariableSettings'
import { WebhookSettings } from './bodies/WebhookSettings'
import { ZapierSettings } from './bodies/ZapierSettings'
type Props = {
step: Exclude<Step, TextBubbleStep>
@ -199,6 +200,9 @@ export const StepSettings = ({
/>
)
}
case IntegrationStepType.ZAPIER: {
return <ZapierSettings step={step} />
}
case IntegrationStepType.WEBHOOK: {
return (
<WebhookSettings

View File

@ -0,0 +1,46 @@
import {
Alert,
AlertIcon,
Button,
Input,
Link,
Stack,
Text,
} from '@chakra-ui/react'
import { ExternalLinkIcon } from 'assets/icons'
import { ZapierStep } from 'models'
import React from 'react'
type Props = {
step: ZapierStep
}
export const ZapierSettings = ({ step }: Props) => {
return (
<Stack spacing={4}>
<Alert
status={step.webhook.url ? 'success' : 'info'}
bgColor={step.webhook.url ? undefined : 'blue.50'}
rounded="md"
>
<AlertIcon />
{step.webhook.url ? (
<>Your zap is correctly configured 🚀</>
) : (
<Stack>
<Text>Head up to Zapier to configure this step:</Text>
<Button
as={Link}
href="https://zapier.com/apps/typebot/integrations"
isExternal
colorScheme="blue"
>
<Text mr="2">Zapier</Text> <ExternalLinkIcon />
</Button>
</Stack>
)}
</Alert>
{step.webhook.url && <Input value={step.webhook.url} isDisabled />}
</Stack>
)
}