MapComplete/src/UI/Popup/SendEmail.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
626 B
Svelte
Raw Normal View History

<script lang="ts">
2023-09-21 15:29:34 +02:00
import type { OsmTags } from "../../Models/OsmFeature"
import Svg from "../../Svg"
import ToSvelte from "../Base/ToSvelte.svelte"
import { Utils } from "../../Utils"
export let tags: Store<OsmTags>
export let args: string[]
2023-09-21 15:29:34 +02:00
let [to, subject, body, button_text] = args.map((a) => Utils.SubstituteKeys(a, $tags))
let url =
"mailto:" + to + "?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body)
</script>
2023-09-21 15:29:34 +02:00
<a class="button flex w-full items-center" href={url}>
<ToSvelte construct={Svg.envelope_svg().SetClass("w-8 h-8 mr-4 shrink-0")} />
{button_text}
</a>