2
0
Files
bot/apps/builder/components/editor/BlocksSideBar/BlockIcon.tsx

102 lines
3.1 KiB
TypeScript
Raw Normal View History

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,
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,
PhoneIcon,
SendEmailIcon,
2022-06-07 19:09:08 +02:00
StarIcon,
2022-01-08 08:20:54 +01:00
TextIcon,
UploadIcon,
2022-01-22 18:24:57 +01:00
WebhookIcon,
2022-01-08 08:20:54 +01:00
} from 'assets/icons'
import {
GoogleAnalyticsLogo,
GoogleSheetsLogo,
MakeComLogo,
PabblyConnectLogo,
ZapierLogo,
} from 'assets/logos'
import {
2022-06-11 07:27:38 +02:00
BubbleBlockType,
InputBlockType,
IntegrationBlockType,
LogicBlockType,
BlockType,
} 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:
return <ChatIcon color="blue.500" {...props} />
2022-06-11 07:27:38 +02:00
case BubbleBlockType.IMAGE:
return <ImageIcon color="blue.500" {...props} />
2022-06-11 07:27:38 +02:00
case BubbleBlockType.VIDEO:
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:
return <TextIcon color="orange.500" {...props} />
2022-06-11 07:27:38 +02:00
case InputBlockType.NUMBER:
return <NumberIcon color="orange.500" {...props} />
2022-06-11 07:27:38 +02:00
case InputBlockType.EMAIL:
return <EmailIcon color="orange.500" {...props} />
2022-06-11 07:27:38 +02:00
case InputBlockType.URL:
return <GlobeIcon color="orange.500" {...props} />
2022-06-11 07:27:38 +02:00
case InputBlockType.DATE:
return <CalendarIcon color="orange.500" {...props} />
2022-06-11 07:27:38 +02:00
case InputBlockType.PHONE:
return <PhoneIcon color="orange.500" {...props} />
2022-06-11 07:27:38 +02:00
case InputBlockType.CHOICE:
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} />
case InputBlockType.FILE:
return <UploadIcon color="orange.500" {...props} />
2022-06-11 07:27:38 +02:00
case LogicBlockType.SET_VARIABLE:
return <EditIcon color="purple.500" {...props} />
2022-06-11 07:27:38 +02:00
case LogicBlockType.CONDITION:
return <FilterIcon color="purple.500" {...props} />
2022-06-11 07:27:38 +02:00
case LogicBlockType.REDIRECT:
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:
return <GoogleSheetsLogo {...props} />
2022-06-11 07:27:38 +02:00
case IntegrationBlockType.GOOGLE_ANALYTICS:
return <GoogleAnalyticsLogo {...props} />
2022-06-11 07:27:38 +02:00
case IntegrationBlockType.WEBHOOK:
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:
return <MakeComLogo {...props} />
2022-06-11 07:27:38 +02:00
case IntegrationBlockType.PABBLY_CONNECT:
return <PabblyConnectLogo {...props} />
2022-06-11 07:27:38 +02:00
case IntegrationBlockType.EMAIL:
return <SendEmailIcon {...props} />
case 'start':
2022-01-12 09:10:59 +01:00
return <FlagIcon {...props} />
2021-12-16 10:43:49 +01:00
}
}