<template>
  <div class="flex items-center p-3 mb-5 bg-white rounded-[10px]">
    <div class="inline-flex items-center cursor-pointer"
         @click="back">
      <img src="@/assets/images/back.png"
           alt=""
           class="" />
      <span class="ml-[6px] text-sm text-[#3C65FF]">返回</span>
    </div>
    <span class="mx-5 text-sm text-[#999]">|</span>
    <span class="text-sm text-[#333]">{{ name }}</span>
  </div>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { logout } from '@/store/useCurrentUser';

const props = defineProps({
  name: { type: String, required: true },
  isLogout: { type: Boolean, default: false },
});
const router = useRouter();
const back = () => {
  props.isLogout ? logout() : router.back();
};
</script>
