Handle onAdd

This commit is contained in:
Adria Navarro 2023-11-09 16:09:34 +01:00
parent 3049f7b376
commit 41cb80bde1
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@
export let title export let title
export let placeholder export let placeholder
export let value export let value
export let onAdd
let searchInput let searchInput
let search = false let search = false
@ -31,7 +32,7 @@
if (search) { if (search) {
closeSearch() closeSearch()
} else { } else {
alert("todo") onAdd()
} }
} }
</script> </script>

View File

@ -27,10 +27,10 @@
title="Sources" title="Sources"
placeholder="Search for sources" placeholder="Search for sources"
bind:value={searchValue} bind:value={searchValue}
onAdd={() => $goto("./new")}
/> />
</span> </span>
<Layout paddingX="L" paddingY="XL" gap="S"> <Layout paddingX="L" paddingY="XL" gap="S">
<Button cta on:click={() => $goto("./new")}>Add source</Button>
<DatasourceNavigator searchTerm={searchValue} /> <DatasourceNavigator searchTerm={searchValue} />
</Layout> </Layout>
</Panel> </Panel>