26 lines
522 B
Vue
26 lines
522 B
Vue
<script setup>
|
|
import { computed } from "vue";
|
|
import { Link } from "@inertiajs/vue3";
|
|
|
|
const props = defineProps({
|
|
href: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
active: {
|
|
type: Boolean,
|
|
},
|
|
});
|
|
|
|
const classes = computed(() =>
|
|
props.active
|
|
? "border-sky-600 border px-3 py-2 rounded bg-sky-600"
|
|
: "border-gray-700 border px-3 py-2 rounded hover:border-sky-600"
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<Link :href="href" :class="classes">
|
|
<slot />
|
|
</Link>
|
|
</template>
|