<template>
  <Button 
    icon="comment" 
    text="反馈纠错" 
    @click="navTo('/pages/article/correct', {
      contentId: content.id,
      title: content.title,
      modelId: content.modelId,
      modelName: content.modelName,
      mainBodyColumnId: content.mainBodyColumnId,
      mainBodyColumnName: content.mainBodyColumnName,
      page: getCurrentPageUrl(),
    })" 
  />
</template>

<script setup lang="ts">
import { type PropType } from 'vue';
import Button from '@/components/basic/Button.vue';
import { navTo } from '@/components/utils/PageAction';
import type { GetContentDetailItem } from '@/api/CommonContent';

defineProps({
  content: {
    type: Object as PropType<GetContentDetailItem>,
    default: () => {},
  },
})

function getCurrentPageUrl() {
  const currentPages = getCurrentPages();
  return currentPages[currentPages.length - 1].route || '';
}
</script>