import { lazy, Suspense } from 'react'; import { NavLink, Navigate, Route, Routes } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Globe, Monitor, ClipboardList, Activity, KeyRound, Braces, Upload } from 'lucide-react'; import type { LucideIcon } from 'lucide-react'; import styles from './App.module.css'; import { NotificationToggle, SidePanel, ThemeSwitcher } from './ui'; import liqaLogo from './assets/liqa.svg'; import { useManifest } from './hooks/useManifest'; import { useRunNotifications } from './hooks/useRunNotifications'; const EnvironmentsPage = lazy(() => import('./pages/environment/EnvironmentsPage').then((m) => ({ default: m.EnvironmentsPage })), ); const EnvironmentDetailPage = lazy(() => import('./pages/environment/EnvironmentDetailPage').then((m) => ({ default: m.EnvironmentDetailPage, })), ); const CreateEnvironmentPage = lazy(() => import('./pages/environment/CreateEnvironmentPage').then((m) => ({ default: m.CreateEnvironmentPage, })), ); const EditEnvironmentPage = lazy(() => import('./pages/environment/EditEnvironmentPage').then((m) => ({ default: m.EditEnvironmentPage, })), ); const SessionsPage = lazy(() => import('./pages/session/SessionsPage').then((m) => ({ default: m.SessionsPage })), ); const SessionDetailPage = lazy(() => import('./pages/session/SessionDetailPage').then((m) => ({ default: m.SessionDetailPage })), ); const ScenariosPage = lazy(() => import('./pages/scenario/ScenariosPage').then((m) => ({ default: m.ScenariosPage })), ); const ScenarioDetailPage = lazy(() => import('./pages/scenario/ScenarioDetailPage').then((m) => ({ default: m.ScenarioDetailPage })), ); const CreateScenarioPage = lazy(() => import('./pages/scenario/CreateScenarioPage').then((m) => ({ default: m.CreateScenarioPage })), ); const EditScenarioPage = lazy(() => import('./pages/scenario/EditScenarioPage').then((m) => ({ default: m.EditScenarioPage })), ); const CreateStepPage = lazy(() => import('./pages/scenario/CreateStepPage').then((m) => ({ default: m.CreateStepPage })), ); const EditStepPage = lazy(() => import('./pages/scenario/EditStepPage').then((m) => ({ default: m.EditStepPage })), ); const RunsPage = lazy(() => import('./pages/run/RunsPage').then((m) => ({ default: m.RunsPage }))); const RunDetailPage = lazy(() => import('./pages/run/RunDetailPage').then((m) => ({ default: m.RunDetailPage })), ); const AllRunsPage = lazy(() => import('./pages/run/AllRunsPage').then((m) => ({ default: m.AllRunsPage })), ); const CredentialsPage = lazy(() => import('./pages/credential/CredentialsPage').then((m) => ({ default: m.CredentialsPage })), ); const CreateCredentialPage = lazy(() => import('./pages/credential/CreateCredentialPage').then((m) => ({ default: m.CreateCredentialPage, })), ); const EditCredentialPage = lazy(() => import('./pages/credential/EditCredentialPage').then((m) => ({ default: m.EditCredentialPage })), ); const CredentialDetailPage = lazy(() => import('./pages/credential/CredentialDetailPage').then((m) => ({ default: m.CredentialDetailPage, })), ); const SnippetsPage = lazy(() => import('./pages/snippet/SnippetsPage').then((m) => ({ default: m.SnippetsPage })), ); const CreateSnippetPage = lazy(() => import('./pages/snippet/CreateSnippetPage').then((m) => ({ default: m.CreateSnippetPage })), ); const EditSnippetPage = lazy(() => import('./pages/snippet/EditSnippetPage').then((m) => ({ default: m.EditSnippetPage })), ); const SnippetDetailPage = lazy(() => import('./pages/snippet/SnippetDetailPage').then((m) => ({ default: m.SnippetDetailPage })), ); const ImportPage = lazy(() => import('./pages/import/ImportPage').then((m) => ({ default: m.ImportPage })), ); const NAV: ({ path: string; labelKey: string; Icon: LucideIcon } | { separator: true })[] = [ { path: '/runs', labelKey: 'nav.runs', Icon: Activity }, { path: '/sessions', labelKey: 'nav.sessions', Icon: Monitor }, { separator: true }, { path: '/scenarios', labelKey: 'nav.scenarios', Icon: ClipboardList }, { path: '/snippets', labelKey: 'nav.snippets', Icon: Braces }, { path: '/credentials', labelKey: 'nav.credentials', Icon: KeyRound }, { path: '/environments', labelKey: 'nav.environments', Icon: Globe }, { separator: true }, { path: '/import', labelKey: 'nav.import', Icon: Upload }, ]; export default function App() { const { t } = useTranslation(); const { version } = useManifest(); const notifications = useRunNotifications(); return (
Liqa
} width={220} >
{notifications && ( )}
v{version} {' '} ·{' '} {t('nav.licenses')}
Loading…

}> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } />
); }