<!-- CustomButton.vue -->
<template>
    <button class="custom-button" @click="handleClick">
      {{ buttonText }}
    </button>
  </template>
  
  <script lang="ts" setup>
  import { defineProps } from 'vue';
  import { useRouter } from 'vue-router';
  const router = useRouter();
  const props = defineProps({
    buttonText: {
      type: String,
      required: true
    }
  });
  
  const handleClick = () => {
    // 这里可以添加点击事件的逻辑
    //判断是否是登录状态

    //跳转到书写页面
    router.push({ name: 'Writing', params: { id: 0 } });
    console.log('Custom button clicked');
  };
  </script>
  
  <style scoped>
  .custom-button {
    position: fixed;
    bottom: 60px; /* 调整位置以固定在回到顶部按钮上方 */
    right: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* 确保按钮在最上层 */
  }
  
  .custom-button:hover {
    background-color: #0056b3;
  }
  </style>