import './App.css'; import { useState } from 'react'; import axios from 'axios'; function App() { const [datasetQuarry, setDatasetQuarry] = useState(''); const [tableQuarry, setTableQuarry] = useState(''); const [columns, setColumns] = useState(''); const [datasetQuarry2, setDatasetQuarry2] = useState(''); const [tableQuarry2, setTableQuarry2] = useState(''); const [columns2, setColumns2] = useState(''); const [results, setResults] = useState(''); const [isVisible, setIsVisible] = useState(true); const fetchDataFromAPI = async (ldataset, ltable, lcolumn, tdataset, ttable, tcolumn) => { try { postML(entryId, ldataset, ltable, lcolumn, tdataset, ttable, tcolumn); } catch (error) { console.error('ERROR fetching data:', error); setResults('Error fetching data'); } }; const handleButtonClick = () => { fetchDataFromAPI(datasetQuarry2, tableQuarry2, columns2, datasetQuarry, tableQuarry, columns); }; const toggleVisibility = () => { setIsVisible(!isVisible); }; return ( {isVisible &&
Learning tables
setDatasetQuarry2(e.target.value)} /> setTableQuarry2(e.target.value)} />
setColumns2(e.target.value)} />
}
Test tables
setDatasetQuarry(e.target.value)} /> setTableQuarry(e.target.value)} />
setColumns(e.target.value)} />
); } export default App;