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", "type": "choice input",
"options": { "options": {
"buttonLabel": "Send", "buttonLabel": "Send",
"isMultipleChoice": false, "isMultipleChoice": false
"variableId": "vcl1sfd8v600432e6exab4vhov"
}, },
"items": [ "items": [
{ {

View File

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