import { FormLabel, HStack, Stack, Text } from '@chakra-ui/react' import { CodeEditor } from '@/components/CodeEditor' import { FileInputOptions, Variable } from 'models' import React from 'react' import { Input, SmartNumberInput } from '@/components/inputs' import { SwitchWithLabel } from '@/components/SwitchWithLabel' import { VariableSearchInput } from '@/components/VariableSearchInput' type Props = { options: FileInputOptions onOptionsChange: (options: FileInputOptions) => void } export const FileInputSettings = ({ options, onOptionsChange }: Props) => { const handleButtonLabelChange = (button: string) => onOptionsChange({ ...options, labels: { ...options.labels, button } }) const handlePlaceholderLabelChange = (placeholder: string) => onOptionsChange({ ...options, labels: { ...options.labels, placeholder } }) const handleMultipleFilesChange = (isMultipleAllowed: boolean) => onOptionsChange({ ...options, isMultipleAllowed }) const handleVariableChange = (variable?: Variable) => onOptionsChange({ ...options, variableId: variable?.id }) const handleSizeLimitChange = (sizeLimit?: number) => onOptionsChange({ ...options, sizeLimit }) const handleRequiredChange = (isRequired: boolean) => onOptionsChange({ ...options, isRequired }) const updateClearButtonLabel = (clear: string) => onOptionsChange({ ...options, labels: { ...options.labels, clear } }) const updateSkipButtonLabel = (skip: string) => onOptionsChange({ ...options, labels: { ...options.labels, skip } }) return ( MB Placeholder: Save upload URL{options.isMultipleAllowed ? 's' : ''} in a variable: ) }