<template>
  <RouterLink v-if="link" :to="link">
    <p
      class="cursor-pointer w-full px-2 py-3"
      :class="active ? 'rounded-r-lg bg-red-200 border-l-4 border-l-primary' : 'pl-3 hover:bg-red-200 rounded-lg'"
    >
      {{ title }}
    </p>
  </RouterLink>
</template>

<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { RouterLink } from "vue-router";
import { mapState, mapActions } from "pinia";
import { useNavigationStore, type navigationLinkModel } from "@/stores/admin/navigation";
</script>

<script lang="ts">
export default defineComponent({
  props: {
    title: {
      type: String,
      default: "LINK",
    },
    link: {
      type: [String, Object as PropType<{ name: string }>],
      default: "/",
    },
    active: {
      type: Boolean,
      default: false,
    },
  },
});
</script>
