<script setup lang="ts">
import { ref } from "vue";

import { useRouter, useRoute } from "vue-router";

import IndicatorByPlan from "@/modules/01_masterdata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue";

const router = useRouter();
const route = useRoute();

const title = ref<string>(
  route.params.id
    ? route.name == "KPIIndicatorByPlanView"
      ? "รายละเอียด"
      : "แก้ไข"
    : "เพิ่ม"
);
</script>
<template>
  <div class="toptitle text-dark col-12 row items-center">
    <q-btn
      flat
      round
      dense
      class="q-mr-sm"
      icon="mdi-arrow-left"
      color="primary"
      @click="router.push(`/masterdata/indicator-plan`)"
    />
    {{ `${title}ตัวชี้วัดตามแผนฯ` }}
  </div>
  <q-card flat bordered>
    <IndicatorByPlan />
  </q-card>
</template>

<style scoped></style>
