import { Box } from '@mui/material'; import React, { useState } from 'react'; import ToolTextInput from '@components/input/ToolTextInput'; import ToolTextResult from '@components/result/ToolTextResult'; import ToolOptions from '@components/options/ToolOptions'; import { compute } from './service'; import TextFieldWithDesc from '@components/options/TextFieldWithDesc'; import ToolInputAndResult from '@components/ToolInputAndResult'; const initialValues = { dotSymbol: '.', dashSymbol: '-' }; export default function ToMorse() { const [input, setInput] = useState(''); const [result, setResult] = useState(''); // const formRef = useRef>(null); const computeOptions = (optionsValues: typeof initialValues, input: any) => { const { dotSymbol, dashSymbol } = optionsValues; setResult(compute(input, dotSymbol, dashSymbol)); }; return ( } result={} /> [ { title: 'Short Signal', component: ( updateField('dotSymbol', val)} /> ) }, { title: 'Long Signal', component: ( updateField('dashSymbol', val)} /> ) } ]} initialValues={initialValues} input={input} /> ); }