<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>
