diff --git a/apps/builder/components/settings/MetadataForm.tsx b/apps/builder/components/settings/MetadataForm.tsx index 2ce264da6..e64c82000 100644 --- a/apps/builder/components/settings/MetadataForm.tsx +++ b/apps/builder/components/settings/MetadataForm.tsx @@ -9,10 +9,7 @@ import { PopoverContent, } from '@chakra-ui/react' import { ImageUploadContent } from 'components/shared/ImageUploadContent' -import { - InputWithVariableButton, - TextareaWithVariableButton, -} from 'components/shared/TextboxWithVariableButton' +import { Input, Textarea } from 'components/shared/Textbox' type Props = { typebotName: string @@ -89,9 +86,9 @@ export const MetadataForm = ({ Title: - @@ -99,9 +96,9 @@ export const MetadataForm = ({ Description: - diff --git a/apps/builder/components/shared/DebouncedInput.tsx b/apps/builder/components/shared/DebouncedInput.tsx deleted file mode 100644 index 642603f2f..000000000 --- a/apps/builder/components/shared/DebouncedInput.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { Input, InputProps } from '@chakra-ui/react' -import { - ChangeEvent, - ForwardedRef, - forwardRef, - useEffect, - useState, -} from 'react' -import { useDebounce } from 'use-debounce' - -type Props = Omit & { - initialValue: string - onChange: (debouncedValue: string) => void -} - -export const DebouncedInput = forwardRef( - ( - { onChange, initialValue, ...props }: Props, - ref: ForwardedRef - ) => { - const [currentValue, setCurrentValue] = useState(initialValue) - const [debouncedValue] = useDebounce( - currentValue, - process.env.NEXT_PUBLIC_E2E_TEST ? 0 : 1000 - ) - - useEffect(() => { - if (debouncedValue === initialValue) return - onChange(debouncedValue) - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [debouncedValue]) - - const handleChange = (e: ChangeEvent) => - setCurrentValue(e.target.value) - - return ( - - ) - } -) diff --git a/apps/builder/components/shared/DebouncedTextarea.tsx b/apps/builder/components/shared/DebouncedTextarea.tsx deleted file mode 100644 index 074140e08..000000000 --- a/apps/builder/components/shared/DebouncedTextarea.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Textarea, TextareaProps } from '@chakra-ui/react' -import { ChangeEvent, useEffect, useState } from 'react' -import { useDebounce } from 'use-debounce' - -type Props = Omit & { - initialValue: string - onChange: (debouncedValue: string) => void -} - -export const DebouncedTextarea = ({ - onChange, - initialValue, - ...props -}: Props) => { - const [currentValue, setCurrentValue] = useState(initialValue) - const [debouncedValue] = useDebounce( - currentValue, - process.env.NEXT_PUBLIC_E2E_TEST ? 0 : 1000 - ) - - useEffect(() => { - if (debouncedValue === initialValue) return - onChange(debouncedValue) - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [debouncedValue]) - - const handleChange = (e: ChangeEvent) => { - setCurrentValue(e.target.value) - } - - return ( -