refactor(components): wrap story actions component's buttons in a nuxt-link

This commit is contained in:
parent dcda8143f9
commit 7a9cbb1ffb
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -1,8 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { theme } from "ant-design-vue"; import { theme } from "ant-design-vue";
import { IStory } from "@models/stories"; import { IStory } from "@models/stories";
import { deleteStory } from "@client/storyActions"; import { deleteStory } from "@client/storyActions";
const props = defineProps<{ story: IStory }>(); const props = defineProps<{ story: IStory }>();
console.log("SINFO", props.story._id);
</script> </script>
<template> <template>
@ -14,14 +15,18 @@
</a-tooltip> </a-tooltip>
</a-popconfirm> </a-popconfirm>
<a-tooltip title="Edit"> <a-tooltip title="Edit">
<a-button type="ghost" @click="$router.push(`/story/${story._id}/edit`)"> <nuxt-link :to="`/story/${story._id}/edit`">
<icon istyle="regular" name="pen-to-square" /> <a-button type="ghost">
</a-button> <icon istyle="regular" name="pen-to-square" />
</a-button>
</nuxt-link>
</a-tooltip> </a-tooltip>
<a-tooltip title="View"> <a-tooltip title="View">
<a-button type="ghost" @click="$router.push(`/story/${story._id}/${story.chapters.length}`)"> <nuxt-link :to="`/story/${story._id}/${story.chapters.length}`">
<icon istyle="regular" name="eye" /> <a-button type="ghost">
</a-button> <icon istyle="regular" name="eye" />
</a-button>
</nuxt-link>
</a-tooltip> </a-tooltip>
</template> </template>