import { PostDto, VisitType } from "@nice/common";
import { useVisitor } from "@nice/client";
import { Button, Tooltip } from "antd";
import {
	DislikeFilled,
	DislikeOutlined,
	SendOutlined,
} from "@ant-design/icons";
import { useAuth } from "@web/src/providers/auth-provider";

export default function PostSendButton({ post }: { post: PostDto }) {
	const { user } = useAuth();
	const { hate, unHate } = useVisitor();
	function sendPost() {
		if (post?.authorId) {
			window.open(`/editor?receiverId=${post?.authorId}`, "_blank");
		}
	}
	return (
		<Button
			title="给他写信"
			type="default"
			shape="round"
			onClick={(e) => {
				e.stopPropagation();
				sendPost();
			}}
			icon={<SendOutlined />}>
			<span className="mr-1">给他写信</span>
		</Button>
	);
}
