import { StackProps, Stack, Flex, Heading, NumberInput, NumberInputField, NumberInputStepper, NumberIncrementStepper, NumberDecrementStepper, Switch, HStack, } from '@chakra-ui/react' import { useState, useEffect } from 'react' import { PopupParams } from 'typebot-js' type PopupEmbedSettingsProps = { onUpdateSettings: (windowSettings: Pick) => void } export const PopupEmbedSettings = ({ onUpdateSettings, ...props }: PopupEmbedSettingsProps & StackProps) => { const [isEnabled, setIsEnabled] = useState(false) const [inputValue, setInputValue] = useState(0) useEffect(() => { onUpdateSettings({ delay: isEnabled ? inputValue * 1000 : undefined, }) // eslint-disable-next-line react-hooks/exhaustive-deps }, [inputValue, isEnabled]) return ( Popup settings

Appearance delay

setIsEnabled(e.target.checked)} />
{isEnabled && ( setInputValue(val)} value={inputValue} min={0} > )}
) }