✨ Introducing The Forge (#1072)
The Forge allows anyone to easily create their own Typebot Block. Closes #380
This commit is contained in:
18
apps/builder/src/features/forge/ForgedBlockIcon.tsx
Normal file
18
apps/builder/src/features/forge/ForgedBlockIcon.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useColorMode } from '@chakra-ui/react'
|
||||
import { ForgedBlock } from '@typebot.io/forge-schemas'
|
||||
import { useForgedBlock } from './hooks/useForgedBlock'
|
||||
|
||||
export const ForgedBlockIcon = ({
|
||||
type,
|
||||
mt,
|
||||
}: {
|
||||
type: ForgedBlock['type']
|
||||
mt?: string
|
||||
}): JSX.Element => {
|
||||
const { colorMode } = useColorMode()
|
||||
const { blockDef } = useForgedBlock(type)
|
||||
if (!blockDef) return <></>
|
||||
if (colorMode === 'dark' && blockDef.DarkLogo)
|
||||
return <blockDef.DarkLogo width="1rem" style={{ marginTop: mt }} />
|
||||
return <blockDef.LightLogo width="1rem" style={{ marginTop: mt }} />
|
||||
}
|
||||
Reference in New Issue
Block a user