import './style.css'
import '@fontsource/inter/latin.css'
import _ from 'lodash'
import { render } from 'preact'
import { useState } from 'preact/hooks'
const ViewRegistry = Object.fromEntries(
Object.entries(
import.meta.glob('./algorithms/*/View.jsx', {
eager: true,
})
/* fix for broken syntax highlighting */
).map(([path, module]) => {
const [id] = path.match(/(?<=\/)[^/]*(?=\/View\.jsx$)/)
return [id, { id, ...module }]
})
)
const NewAlgorithmBox = ({ title, description, onClick }) => (
)
const AlgorithmChooserView = ({ setCurrentView }) => {
const sections = _.groupBy(ViewRegistry, 'metadata.group')
return (
<>
Algoritmi
{Object.entries(sections).map(([group, algorithms]) => (
{group}
{algorithms.map(({ id, metadata }) => (
setCurrentView(id)}
/>
))}
))}
>
)
}
const Main = ({}) => {
const [currentView, setCurrentView] = useState(null)
if (!currentView) {
return
}
const View = ViewRegistry[currentView].View
return
}
const App = ({}) => {
return (
<>
Visualizzazioni di Ricerca Operativa
>
)
}
render(, document.body)