2
0
Files
bot/apps/builder/components/dashboard/FolderContent/CreateBotButton.tsx

48 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-12-06 15:48:50 +01:00
import { Button, ButtonProps, Text, VStack } from '@chakra-ui/react'
import { PlusIcon } from 'assets/icons'
import { useRouter } from 'next/router'
2022-03-23 09:56:39 +01:00
import { stringify } from 'qs'
2021-12-06 15:48:50 +01:00
import React from 'react'
export const CreateBotButton = ({
folderId,
2022-03-23 09:56:39 +01:00
isFirstBot,
2021-12-06 15:48:50 +01:00
...props
2022-03-23 09:56:39 +01:00
}: { folderId?: string; isFirstBot: boolean } & ButtonProps) => {
2021-12-06 15:48:50 +01:00
const router = useRouter()
const handleClick = () =>
2022-03-23 09:56:39 +01:00
router.push(
`/typebots/create?${stringify({
isFirstBot: !isFirstBot ? undefined : isFirstBot,
folderId,
})}`
)
2021-12-06 15:48:50 +01:00
return (
<Button
mr={{ sm: 6 }}
mb={6}
style={{ width: '225px', height: '270px' }}
onClick={handleClick}
paddingX={6}
whiteSpace={'normal'}
2021-12-23 09:37:42 +01:00
colorScheme="blue"
2021-12-06 15:48:50 +01:00
{...props}
>
<VStack spacing="6">
<PlusIcon fontSize="40px" />
<Text
fontSize={18}
fontWeight="medium"
maxW={40}
textAlign="center"
mt="6"
>
Create a typebot
</Text>
</VStack>
</Button>
)
}