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-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-01-08 08:20:54 +01:00
|
|
|
TextIcon,
|
2022-01-22 18:24:57 +01:00
|
|
|
WebhookIcon,
|
2022-01-08 08:20:54 +01:00
|
|
|
} from 'assets/icons'
|
2022-02-22 08:03:38 +01:00
|
|
|
import { GoogleAnalyticsLogo, GoogleSheetsLogo, ZapierLogo } from 'assets/logos'
|
2022-01-18 18:25:18 +01:00
|
|
|
import {
|
|
|
|
BubbleStepType,
|
|
|
|
InputStepType,
|
|
|
|
IntegrationStepType,
|
|
|
|
LogicStepType,
|
|
|
|
StepType,
|
|
|
|
} from 'models'
|
2021-12-16 10:43:49 +01:00
|
|
|
import React from 'react'
|
|
|
|
|
2022-01-12 09:10:59 +01:00
|
|
|
type StepIconProps = { type: StepType } & IconProps
|
2021-12-16 10:43:49 +01:00
|
|
|
|
2022-01-12 09:10:59 +01:00
|
|
|
export const StepIcon = ({ type, ...props }: StepIconProps) => {
|
2021-12-16 10:43:49 +01:00
|
|
|
switch (type) {
|
2022-01-18 18:25:18 +01:00
|
|
|
case BubbleStepType.TEXT:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <ChatIcon color="blue.500" {...props} />
|
2022-01-20 16:14:47 +01:00
|
|
|
case BubbleStepType.IMAGE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <ImageIcon color="blue.500" {...props} />
|
2022-01-20 17:45:25 +01:00
|
|
|
case BubbleStepType.VIDEO:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <FilmIcon color="blue.500" {...props} />
|
2022-03-23 12:01:35 +01:00
|
|
|
case BubbleStepType.EMBED:
|
|
|
|
return <LayoutIcon color="blue.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case InputStepType.TEXT:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <TextIcon color="orange.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case InputStepType.NUMBER:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <NumberIcon color="orange.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case InputStepType.EMAIL:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <EmailIcon color="orange.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case InputStepType.URL:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <GlobeIcon color="orange.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case InputStepType.DATE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <CalendarIcon color="orange.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case InputStepType.PHONE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <PhoneIcon color="orange.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case InputStepType.CHOICE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <CheckSquareIcon color="orange.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case LogicStepType.SET_VARIABLE:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <EditIcon color="purple.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case LogicStepType.CONDITION:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <FilterIcon color="purple.500" {...props} />
|
2022-01-20 07:21:08 +01:00
|
|
|
case LogicStepType.REDIRECT:
|
2022-01-29 11:22:22 +01:00
|
|
|
return <ExternalLinkIcon color="purple.500" {...props} />
|
2022-03-07 17:39:57 +01:00
|
|
|
case LogicStepType.CODE:
|
|
|
|
return <CodeIcon color="purple.500" {...props} />
|
2022-03-09 15:12:00 +01:00
|
|
|
case LogicStepType.TYPEBOT_LINK:
|
|
|
|
return <BoxIcon color="purple.500" {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case IntegrationStepType.GOOGLE_SHEETS:
|
|
|
|
return <GoogleSheetsLogo {...props} />
|
2022-01-19 14:25:15 +01:00
|
|
|
case IntegrationStepType.GOOGLE_ANALYTICS:
|
|
|
|
return <GoogleAnalyticsLogo {...props} />
|
2022-01-22 18:24:57 +01:00
|
|
|
case IntegrationStepType.WEBHOOK:
|
2022-02-07 18:06:37 +01:00
|
|
|
return <WebhookIcon {...props} />
|
2022-02-22 08:03:38 +01:00
|
|
|
case IntegrationStepType.ZAPIER:
|
|
|
|
return <ZapierLogo {...props} />
|
2022-02-07 18:06:37 +01:00
|
|
|
case IntegrationStepType.EMAIL:
|
|
|
|
return <SendEmailIcon {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
case 'start':
|
2022-01-12 09:10:59 +01:00
|
|
|
return <FlagIcon {...props} />
|
2022-01-18 18:25:18 +01:00
|
|
|
default:
|
2022-01-08 07:40:55 +01:00
|
|
|
return <></>
|
2021-12-16 10:43:49 +01:00
|
|
|
}
|
|
|
|
}
|