<template>
  <AdminLayout>
    <Breadcrumb currentPageText="Menü Listesi" go="/"/>
    <section class="section-list">
      <list-table-content
        :tableHeader="tableHeader"
        :rowAction="OpenMenu"
        icon="sitemanagement"
        title="Menüler"
        listText="Menü"
        :tableData="menuList"
        apiText="Menü Listesi"
        v-model:refresh="refreshList" />
    </section>
  </AdminLayout>
</template>
<script setup lang="ts">
  import { ref, reactive } from 'vue'
  import AdminLayout from '@/layouts/AdminLayout.vue'
  import { Breadcrumb } from '@/components/global'
  import router from '@/router'

  const refreshList = ref<boolean>(false)
  const tableHeader = ref<Record<string, any>[]>([
    {
      name: 'title',
      title: 'Menü',
      sort: true
    }
  ])

  const menuList = ref<Record<string,any>[]>([
    {title:"Ana Menü",positionId:1},
    {title:"Footer Menü",positionId:2}
  ])

  const OpenMenu = (row: any) => {
    router.push('menu-yonetimi/' + row.positionId)
  }
</script>
