<template>
	<div class="redressBox">
		<div class="addBox joinBox">
			<div v-if="props.isShow.includes(2)" class="btnBox">
				<router-link
					:to="{
						path: '/forum/addForum',
						query: { postType: 2, resourceType: props.resourceType, ...props.forumData }
					}"
					target="_blank"
				>
					<CopyOutlined style="font-size: 30px" class="textColor" />
					<div class="textColor">纠错</div>
				</router-link>
			</div>
			<div v-if="props.isShow.includes(1)" class="btnBox mt-2">
				<router-link
					:to="{
						path: '/forum/addForum',
						query: { postType: 1, resourceType: props.resourceType, ...props.forumData }
					}"
					target="_blank"
				>
					<SnippetsOutlined class="textColor" style="font-size: 30px" />
					<div class="textColor">技术</div>
				</router-link>
			</div>
			<div v-if="props.isShow.includes(0)" class="btnBox mt-2">
				<router-link
					:to="{
						path: '/forum/detail',
						query: { postType: 4, resourceType: props.resourceType, ...props.forumData }
					}"
					target="_blank"
				>
					<FileTextOutlined class="textColor" style="font-size: 30px" />
					<div class="textColor">章节</div>
				</router-link>
			</div>
		</div>
		<div class="mt-4 joinBox">
			<div v-if="props.isShow.includes(3)" class="btnBox mt-2">
				<router-link :to="{ path: '/forum' }" target="_blank">
					<CommentOutlined class="textColor" style="font-size: 30px" />
					<div class="textColor">讨论</div>
				</router-link>
			</div>
		</div>
	</div>
</template>

<script setup>
	import { useRoute, useRouter } from 'vue-router'
	const router = useRouter()
	const props = defineProps({
		isShow: {
			type: Array,
			default: [0, 1, 2, 3]
		},
		forumData: {
			type: Object,
			default: () => {}
		},
		resourceType: {
			type: [String, Number],
			default: ''
		}
	})
	const jumpRedressUrl = (t) => {
		router.push({
			path: '/forum/addForum',
			query: {
				...props.forumData,
				postType: t,
				resourceType: props.resourceType
			}
		})
	}
</script>

<style lang="less" scoped>
	.redressBox {
		position: fixed;
		right: 20px;
		bottom: 150px;
	}
	.addBox {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
	}
	.joinBox {
		background-color: #fff;
		border-radius: 5px;
		padding: 10px;
	}
	.textColor {
		color: #969696;
	}
	.btnBox {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		cursor: pointer;
	}
</style>
