2022-01-12 09:10:59 +01:00
|
|
|
import { IconProps } from '@chakra-ui/react'
|
2022-01-08 08:20:54 +01:00
|
|
|
import {
|
2022-03-09 15:12:00 +01:00
|
|
|
BoxIcon,
|
2022-01-10 08:05:03 +01:00
|
|
|
CalendarIcon,
|
2022-01-08 08:20:54 +01:00
|
|
|
ChatIcon,
|
2022-01-12 09:10:59 +01:00
|
|
|
CheckSquareIcon,
|
2022-03-07 17:39:57 +01:00
|
|
|
CodeIcon,
|
2022-05-24 14:25:15 -07:00
|
|
|
CreditCardIcon,
|
2022-01-14 07:49:24 +01:00
|
|
|
EditIcon,
|
2022-01-08 08:20:54 +01:00
|
|
|
EmailIcon,
|
2022-01-20 07:21:08 +01:00
|
|
|
ExternalLinkIcon,
|
2022-01-20 17:45:25 +01:00
|
|
|
FilmIcon,
|
2022-01-15 17:30:20 +01:00
|
|
|
FilterIcon,
|
2022-01-08 08:20:54 +01:00
|
|
|
FlagIcon,
|
2022-01-09 07:36:29 +01:00
|
|
|
GlobeIcon,
|
2022-01-20 16:14:47 +01:00
|
|
|
ImageIcon,
|
2022-03-23 12:01:35 +01:00
|
|
|
LayoutIcon,
|
2022-01-08 08:20:54 +01:00
|
|
|
NumberIcon,
|
2022-01-10 10:43:27 +01:00
|
|
|
PhoneIcon,
|
2022-02-07 18:06:37 +01:00
|
|
|
SendEmailIcon,
|
2022-06-07 19:09:08 +02:00
|
|
|
StarIcon,
|
2022-01-08 08:20:54 +01:00
|
|
|
TextIcon,
|
2022-06-12 17:34:33 +02:00
|
|
|
UploadIcon,
|
2022-01-22 18:24:57 +01:00
|
|
|
WebhookIcon,
|
2022-01-08 08:20:54 +01:00
|
|
|
} from 'assets/icons'
|
2022-04-10 17:02:01 -05:00
|
|
|
import {
|
|
|
|
GoogleAnalyticsLogo,
|
|
|
|
GoogleSheetsLogo,
|
|
|
|
MakeComLogo,
|
2022-04-12 12:10:20 -05:00
|
|
|
PabblyConnectLogo,
|
2022-04-10 17:02:01 -05:00
|
|
|
ZapierLogo,
|
|
|
|
} from 'assets/logos'
|
2022-01-18 18:25:18 +01:00
|
|
|
import {
|
2022-06-11 07:27:38 +02:00
|
|
|
BubbleBlockType,
|
|
|
|
InputBlockType,
|
|
|
|
IntegrationBlockType,
|
|
|
|
LogicBlockType,
|
|
|
|
BlockType,
|
2022-01-18 18:25:18 +01:00
|
|
|
} from 'models'
|
2021-12-16 10:43:49 +01:00
|
|
|
import React from 'react'
|
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
type BlockIconProps = { type: BlockType } & IconProps
|
2021-12-16 10:43:49 +01:00
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export const BlockIcon = ({ type, ...props }: BlockIconProps) => {
|
2021-12-16 10:43:49 +01:00
|
|
|
switch (type) {
|
2022-06-11 07:27:38 +02:00
|
|
|
case BubbleBlockType.TEXT:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <ChatIcon color="blue.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case BubbleBlockType.IMAGE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <ImageIcon color="blue.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case BubbleBlockType.VIDEO:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <FilmIcon color="blue.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case BubbleBlockType.EMBED:
|
2022-03-23 12:01:35 +01:00
|
|
|
return <LayoutIcon color="blue.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.TEXT:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <TextIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.NUMBER:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <NumberIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.EMAIL:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <EmailIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.URL:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <GlobeIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.DATE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <CalendarIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.PHONE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <PhoneIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.CHOICE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <CheckSquareIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.PAYMENT:
|
2022-05-24 14:25:15 -07:00
|
|
|
return <CreditCardIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case InputBlockType.RATING:
|
2022-06-07 19:09:08 +02:00
|
|
|
return <StarIcon color="orange.500" {...props} />
|
2022-06-12 17:34:33 +02:00
|
|
|
case InputBlockType.FILE:
|
|
|
|
return <UploadIcon color="orange.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case LogicBlockType.SET_VARIABLE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <EditIcon color="purple.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case LogicBlockType.CONDITION:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <FilterIcon color="purple.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case LogicBlockType.REDIRECT:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <ExternalLinkIcon color="purple.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case LogicBlockType.CODE:
|
2022-03-07 17:39:57 +01:00
|
|
|
return <CodeIcon color="purple.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case LogicBlockType.TYPEBOT_LINK:
|
2022-03-09 15:12:00 +01:00
|
|
|
return <BoxIcon color="purple.500" {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case IntegrationBlockType.GOOGLE_SHEETS:
|
2022-01-18 18:25:18 +01:00
|
|
|
return <GoogleSheetsLogo {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case IntegrationBlockType.GOOGLE_ANALYTICS:
|
2022-01-19 14:25:15 +01:00
|
|
|
return <GoogleAnalyticsLogo {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case IntegrationBlockType.WEBHOOK:
|
2022-02-07 18:06:37 +01:00
|
|
|
return <WebhookIcon {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case IntegrationBlockType.ZAPIER:
|
2022-02-22 08:03:38 +01:00
|
|
|
return <ZapierLogo {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case IntegrationBlockType.MAKE_COM:
|
2022-04-10 17:02:01 -05:00
|
|
|
return <MakeComLogo {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case IntegrationBlockType.PABBLY_CONNECT:
|
2022-04-12 12:10:20 -05:00
|
|
|
return <PabblyConnectLogo {...props} />
|
2022-06-11 07:27:38 +02:00
|
|
|
case IntegrationBlockType.EMAIL:
|
2022-02-07 18:06:37 +01:00
|
|
|
return <SendEmailIcon {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case 'start':
|
2022-01-12 09:10:59 +01:00
|
|
|
return <FlagIcon {...props} />
|
2021-12-16 10:43:49 +01:00
|
|
|
}
|
|
|
|
}
|