<script setup lang="ts">
import {RouterLink, RouterView} from 'vue-router';
import {isMain, useLedgerParam} from "@/ledger";
import {routeNames} from "@/routes.ts";

const {ledgerId, ledger} = useLedgerParam();

</script>

<template>
  <div v-if="ledger" class="mt-4">
    <div class="flex border-b-2 border-emerald-500">
      <RouterLink :to="{name: routeNames.viewLedgerBalance}" class="tab">
        <span>Balance</span>
      </RouterLink>
      <RouterLink v-if="isMain(ledger)" :to="{name: routeNames.listLedgerTransactions}" class="tab">
        <span>Transactions</span>
      </RouterLink>
    </div>
    <RouterView />
  </div>
</template>
