Skip to content
Snippets Groups Projects
comment-button.tsx 760 B
Newer Older
"use client"

import { Prisma } from "@prisma/client";
import { useRouter } from "next/navigation";
import { startTransition } from "react";
import { Icons } from "./icons";
import { Button } from "./ui/button";
import Link from "next/link";

export default function CommentButton(props: { data: any }) {

    const postid = props.data.id
    const replyCount = props.data.Comment.length
    //const replyCount = props.data.likeCount
    return (
        <div>
            <Link href={`/home/${postid}`}>
                <Button type="submit" variant="ghost" size="lg" className="float-right" >
                    {replyCount}
                    <Icons.messagecircle className="h-3 w-3" />
                </Button>
            </Link>
        </div>
    )
}