working on search

This commit is contained in:
2025-08-19 09:08:10 +02:00
parent 9aca5bd088
commit 91147d736d
4 changed files with 56 additions and 21 deletions

View File

@@ -5,6 +5,7 @@ import { useTinyRouter } from 'svelte-tiny-router';
import { logout, user } from '../user.svelte.js';
import { t } from '../translations.svelte.js';
let key = $state(null);
const router = useTinyRouter();
const modules = $state([]);
@@ -27,6 +28,12 @@ function go(path){
return false;
}
async function search(e){
e.preventDefault();
router.navigate(`/search?key=${key}`);
return false;
}
onMount(fetchModules);
</script>
@@ -37,6 +44,10 @@ onMount(fetchModules);
</style>
<nav>
<form onsubmit={search}>
<input type="text" bind:value={key} />
<button type="submit">{t('search')}</button>
</form>
<a href="#" onclick={() => go('/user')}>{t('users')}</a>
<a href="#" onclick={() => go('/company')}>{t('companies')}</a>
<a href="#" onclick={() => go('/project')}>{t('projects')}</a>