2
0

feat: 🛂 Restrict file upload input

This commit is contained in:
Baptiste Arnaud
2022-06-12 19:16:35 +02:00
parent 75365a0d82
commit 353923e029
5 changed files with 69 additions and 10 deletions

View File

@ -1,4 +1,5 @@
import { Text, Tooltip } from '@chakra-ui/react'
import { HStack, Tag, Text, Tooltip } from '@chakra-ui/react'
import { useWorkspace } from 'contexts/WorkspaceContext'
import {
BubbleBlockType,
InputBlockType,
@ -7,10 +8,13 @@ import {
BlockType,
} from 'models'
import React from 'react'
import { isFreePlan } from 'services/workspace'
type Props = { type: BlockType }
export const BlockTypeLabel = ({ type }: Props): JSX.Element => {
const { workspace } = useWorkspace()
switch (type) {
case 'start':
return <Text>Start</Text>
@ -46,7 +50,14 @@ export const BlockTypeLabel = ({ type }: Props): JSX.Element => {
case InputBlockType.FILE:
return (
<Tooltip label="Upload Files">
<Text>File</Text>
<HStack>
<Text>File</Text>
{isFreePlan(workspace) && (
<Tag colorScheme="orange" size="sm">
Pro
</Tag>
)}
</HStack>
</Tooltip>
)
case LogicBlockType.SET_VARIABLE: