2
0

🐛 (editor) Don't show variable collection if not recognized

This commit is contained in:
Baptiste Arnaud
2023-01-12 16:03:12 +01:00
parent f8351e2c85
commit ecc7e18226
2 changed files with 19 additions and 12 deletions

View File

@ -429,8 +429,7 @@
"type": "choice input",
"options": {
"buttonLabel": "Send",
"isMultipleChoice": false,
"variableId": "vcl1sfd8v600432e6exab4vhov"
"isMultipleChoice": false
},
"items": [
{

View File

@ -226,13 +226,21 @@ const CollectVariableLabel = ({
}: {
variableId: string
variables: Variable[]
}) => (
}) => {
const textColor = useColorModeValue('gray.600', 'gray.400')
const variableName = variables.find(
(variable) => variable.id === variableId
)?.name
if (!variableName) return null
return (
<HStack fontStyle="italic" spacing={1}>
<Text fontSize="sm" color={useColorModeValue('gray.600', 'gray.400')}>
<Text fontSize="sm" color={textColor}>
Collects
</Text>
<Tag bg="orange.400" color="white" size="sm">
{variables.find((variable) => variable.id === variableId)?.name}
{variableName}
</Tag>
</HStack>
)
}