Refactoring: port element to Svelte

This commit is contained in:
Pieter Vander Vennet 2025-02-12 16:51:37 +01:00
parent 7ff3b6e912
commit a6719da011
2 changed files with 28 additions and 16 deletions

View file

@ -0,0 +1,20 @@
<script lang="ts">
import Trash from "@babeard/svelte-heroicons/mini/Trash"
import { WithSelectedElementState } from "../../Models/ThemeViewState/WithSelectedElementState"
import Translations from "../i18n/Translations"
import Tr from "../Base/Tr.svelte"
export let state: WithSelectedElementState
function clear() {
console.log("Clearing history")
state.historicalUserLocations.features.setData([])
state.selectedElement.setData(undefined)
}
</script>
<button on:click={() => clear()}>
<Trash class="w-6 h-6" />
<Tr t={Translations.t.general.removeLocationHistory} />
</button>