2022-11-17 10:33:17 +01:00
|
|
|
import { Text } from '@chakra-ui/react'
|
2023-03-15 08:35:16 +01:00
|
|
|
import { AudioBubbleContent } from '@typebot.io/schemas'
|
|
|
|
import { isDefined } from '@typebot.io/lib'
|
2023-09-05 18:15:59 +02:00
|
|
|
import { useScopedI18n } from '@/locales'
|
2022-11-17 10:33:17 +01:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
url: AudioBubbleContent['url']
|
|
|
|
}
|
|
|
|
|
2023-09-05 18:15:59 +02:00
|
|
|
export const AudioBubbleNode = ({ url }: Props) => {
|
|
|
|
const scopedT = useScopedI18n('editor.blocks.bubbles.audio.node')
|
|
|
|
return isDefined(url) ? (
|
2022-11-17 10:33:17 +01:00
|
|
|
<audio src={url} controls />
|
|
|
|
) : (
|
2023-09-05 18:15:59 +02:00
|
|
|
<Text color={'gray.500'}>{scopedT('clickToEdit.text')}</Text>
|
2022-11-17 10:33:17 +01:00
|
|
|
)
|
2023-09-05 18:15:59 +02:00
|
|
|
}
|