@ -12,9 +12,9 @@ import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/const
|
||||
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/constants'
|
||||
import { LogicBlockType } from '@typebot.io/schemas/features/blocks/logic/constants'
|
||||
import { BlockV6 } from '@typebot.io/schemas'
|
||||
import { enabledBlocks } from '@typebot.io/forge-repository'
|
||||
import { BlockCardLayout } from './BlockCardLayout'
|
||||
import { ForgedBlockCard } from '@/features/forge/ForgedBlockCard'
|
||||
import { isForgedBlockType } from '@typebot.io/schemas/features/blocks/forged/helpers'
|
||||
|
||||
type Props = {
|
||||
type: BlockV6['type']
|
||||
@ -30,13 +30,8 @@ export const BlockCard = (
|
||||
const { t } = useTranslate()
|
||||
const { workspace } = useWorkspace()
|
||||
|
||||
if (enabledBlocks.includes(props.type as (typeof enabledBlocks)[number])) {
|
||||
return (
|
||||
<ForgedBlockCard
|
||||
type={props.type as (typeof enabledBlocks)[number]}
|
||||
onMouseDown={props.onMouseDown}
|
||||
/>
|
||||
)
|
||||
if (isForgedBlockType(props.type)) {
|
||||
return <ForgedBlockCard type={props.type} onMouseDown={props.onMouseDown} />
|
||||
}
|
||||
switch (props.type) {
|
||||
case BubbleBlockType.EMBED:
|
||||
|
@ -23,8 +23,8 @@ import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/const
|
||||
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/constants'
|
||||
import { LogicBlockType } from '@typebot.io/schemas/features/blocks/logic/constants'
|
||||
import { BlockV6 } from '@typebot.io/schemas'
|
||||
import { enabledBlocks } from '@typebot.io/forge-repository'
|
||||
import { useDebouncedCallback } from 'use-debounce'
|
||||
import { forgedBlockIds } from '@typebot.io/forge-repository/constants'
|
||||
|
||||
// Integration blocks migrated to forged blocks
|
||||
const legacyIntegrationBlocks = [
|
||||
@ -174,7 +174,7 @@ export const BlocksSideBar = () => {
|
||||
</Text>
|
||||
<SimpleGrid columns={2} spacing="3">
|
||||
{Object.values(IntegrationBlockType)
|
||||
.concat(enabledBlocks as any)
|
||||
.concat(forgedBlockIds as any)
|
||||
.filter((type) => !legacyIntegrationBlocks.includes(type))
|
||||
.map((type) => (
|
||||
<BlockCard
|
||||
|
Reference in New Issue
Block a user