import {useState} from 'react'; import InputChips from './components/InputChip'; const App = () => { const [chips, setChips] = useState([]); const [inputValue, setInputValue] = useState(''); const [error, setError] = useState<{inputValueError?: string}>({}); const validation = () => { const tempErr: {inputValueError?: string} = {}; if (!inputValue.trim().length) { tempErr.inputValueError = 'atleast add one message'; } if (chips.length > 10) { tempErr.inputValueError = 'max 10 chips'; } setError(tempErr); return Object.keys(tempErr).length <= 0; }; return ( ); }; export default App;