import { ref, computed } from "vue";
import { getId } from "../handlers.js";

const html = (v) => { return v[0] };

export default {
  props: ['elements', 'title', 'type', "withshortkey"],
  setup(props) {
    return { }
  },
  template: html`
    <h2 v-if="!!title">{{ title }}</h2>
    <nav class="list" :class="{ horizontal: type == 'horizontal', vertical: type != 'horizontal'}">
      <component :is="item.component" v-for="(item, index) in elements" v-index  :withshortkey="withshortkey"  @click="item.onClick" v-bind="item.props">
      </component>
    </nav>
  `
}
