27
apps/builder/src/components/SetVariableLabel.tsx
Normal file
27
apps/builder/src/components/SetVariableLabel.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { useColorModeValue, HStack, Tag, Text } from '@chakra-ui/react'
|
||||
import { Variable } from 'models'
|
||||
|
||||
export const SetVariableLabel = ({
|
||||
variableId,
|
||||
variables,
|
||||
}: {
|
||||
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={textColor}>
|
||||
Set
|
||||
</Text>
|
||||
<Tag bg="orange.400" color="white" size="sm">
|
||||
{variableName}
|
||||
</Tag>
|
||||
</HStack>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user