import Header from "@/src/components/layouts/header"; import { Button } from "@/src/components/ui/button"; import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@/src/components/ui/drawer"; import { CommentList } from "@/src/features/comments/CommentList"; import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess"; import { type CommentObjectType } from "@langfuse/shared"; import { MessageCircleIcon, MessageCircleOff } from "lucide-react"; import React from "react"; export function CommentDrawerButton({ projectId, objectId, objectType, count, variant = "secondary", className, }: { projectId: string; objectId: string; objectType: CommentObjectType; count?: number; variant?: "secondary" | "outline"; className?: string; }) { const hasReadAccess = useHasProjectAccess({ projectId, scope: "comments:read", }); const hasWriteAccess = useHasProjectAccess({ projectId, scope: "comments:CUD", }); if (!hasReadAccess || (!hasWriteAccess && !count)) return ( ); return ( {!!count ? ( {count > 99 ? "99+" : count} ) : ( )} ); }