swaf/src/assets/views/components/NavMenuItem.svelte

24 lines
519 B
Svelte
Raw Normal View History

2021-06-01 16:14:24 +02:00
<script>
import CsrfTokenField from "../utils/CsrfTokenField.svelte";
export let href;
export let icon;
export let text;
export let action = false;
</script>
<li>
{#if action}
<form action={href} method="POST">
<button><i data-feather={icon}></i> <span class="tip">{text}</span></button>
<CsrfTokenField/>
</form>
{:else}
<a href={href}>
<i data-feather={icon}></i> <span class="tip">{text}</span>
</a>
{/if}
</li>