Files
bot/apps/builder/src/features/blocks/integrations/webhook/components/WebhookContent.tsx

21 lines
519 B
TypeScript
Raw Normal View History

2022-01-22 18:24:57 +01:00
import { Text } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
2022-06-11 07:27:38 +02:00
import { WebhookBlock } from 'models'
import { byId } from 'utils'
2022-01-22 18:24:57 +01:00
type Props = {
2022-06-11 07:27:38 +02:00
block: WebhookBlock
2022-01-22 18:24:57 +01:00
}
2022-06-11 07:27:38 +02:00
export const WebhookContent = ({ block: { webhookId } }: Props) => {
const { webhooks } = useTypebot()
const webhook = webhooks.find(byId(webhookId))
2022-01-22 18:24:57 +01:00
if (!webhook?.url) return <Text color="gray.500">Configure...</Text>
return (
2022-05-13 09:18:25 -07:00
<Text noOfLines={2} pr="6">
2022-01-22 18:24:57 +01:00
{webhook.method} {webhook.url}
</Text>
)
}