<script>
import { provide } from 'vue';
import { keys as injectionKeys } from '../injection';

export default {
  name: 'PageMaster',
  setup() {
    provide(injectionKeys.links, {
      resourceViewLinkFn: r => `/master/timetable/resources/${r.id}/index`,
      eventLinkFn: e => `/master/timetable/events/${e.id}/index`,
      eventChangeLinkFn: e => `/master/timetable/events/${e.id}/index`,
      dateTimeTableLinkFn: d => `/master/timetable/datetimeline/${
        d.isoFormat()
      }`,
      resourceTimeTableLinkFn: r => `/master/timetable/resources/${
        r.id
      }/timeline`,
    });
  },
}
</script>

<template>
<div class="body">
  <h1>ZKan</h1>
  <nav>
    <ul>
      <li>
        <router-link to="/master/timetable/index">時間割表示・入力</router-link>
      </li>
      <li>
        <router-link to="/master/config/index">設定・メンテナンス</router-link>
      </li>
      <li>
        <router-link to="/master/import-export">
          データインポート・エクスポート
        </router-link>
      </li>
    </ul>
  </nav>
  <section>
    <router-view />
  </section>
</div>
</template>

<style scoped>
.body {
  margin: .5em;
}
</style>
