import { useEffect, useState } from 'react' import { Settings } from 'lucide-react' import ZeroShotClassification from './components/ZeroShotClassification' import TextClassification from './components/TextClassification' import Header from './Header' import { useModel } from './contexts/ModelContext' import { getModelsByPipeline } from './lib/huggingface' import TextGeneration from './components/TextGeneration' import FeatureExtraction from './components/FeatureExtraction' import Sidebar from './components/Sidebar' import ModelReadme from './components/ModelReadme' import { PipelineLayout } from './components/PipelineLayout' function App() { const [isSidebarOpen, setIsSidebarOpen] = useState(false) const { pipeline, setModels, setModelInfo, modelInfo, setIsFetching } = useModel() useEffect(() => { setModelInfo(null) setModels([]) setIsFetching(true) const fetchModels = async () => { try { const fetchedModels = await getModelsByPipeline(pipeline) setModels(fetchedModels) } catch (error) { console.error('Error fetching models:', error) setIsFetching(false) } } fetchModels() }, [setModels, setModelInfo, setIsFetching, pipeline]) return (