Add icon picker (#496)

Closes #495
This commit is contained in:
Baptiste Arnaud
2023-05-11 10:32:33 -04:00
committed by GitHub
parent 36bec36775
commit 9abc50dce5
1404 changed files with 1587 additions and 30 deletions

View File

@@ -1,6 +1,7 @@
import { ToolIcon } from '@/components/icons'
import React from 'react'
import { chakra, IconProps, Image } from '@chakra-ui/react'
import { isSvgSrc } from '@typebot.io/lib/utils'
type Props = {
icon?: string | null
@@ -18,11 +19,11 @@ export const EmojiOrImageIcon = ({
return (
<>
{icon ? (
icon.startsWith('http') ? (
icon.startsWith('http') || isSvgSrc(icon) ? (
<Image
src={icon}
boxSize={boxSize}
objectFit={icon.endsWith('.svg') ? undefined : 'cover'}
objectFit={isSvgSrc(icon) ? undefined : 'cover'}
alt="typebot icon"
rounded="10%"
/>