<script lang="ts">
    export let menudata: {menuName: string, menuLink: string}[] = [];
    $: colNum = (Math.floor(menudata.length / 2) < 3) ? Math.floor(menudata.length / 2) : 3;
</script>
<div class="grid gap-y-6 gap-x-6 grid-cols-{colNum} text-center sm:grid-cols-1 justify-content-center">
{#each menudata as menu}
    <a href="{menu.menuLink}" target="_self">
        <div class="flex content-center justify-center border rounded-md border-black dark:border-white border-solid px-6 py-8 dark:hover:bg-zinc-900 dark:bg-transparent bg-transparent min-w-[50%]">
            <h2 class='text-xl'>{menu.menuName}</h2>
        </div>
    </a>
{/each}
</div>
