mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
feat(web): add comment trigger and improve panel empty state
This commit is contained in:
parent
d719370dc2
commit
8de448a8ce
4 changed files with 164 additions and 4 deletions
|
|
@ -0,0 +1,29 @@
|
|||
"use client";
|
||||
|
||||
import { MessageSquare } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { CommentTriggerProps } from "./types";
|
||||
|
||||
export function CommentTrigger({ commentCount, isOpen, onClick }: CommentTriggerProps) {
|
||||
const hasComments = commentCount > 0;
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant={isOpen ? "secondary" : "ghost"}
|
||||
size="sm"
|
||||
className={cn(
|
||||
"h-8 gap-1.5 px-2 transition-opacity",
|
||||
isOpen ? "text-foreground" : "text-muted-foreground",
|
||||
!hasComments && !isOpen && "opacity-0 group-hover:opacity-100"
|
||||
)}
|
||||
onClick={onClick}
|
||||
>
|
||||
<MessageSquare className={cn("size-4", isOpen && "fill-current")} />
|
||||
{hasComments && (
|
||||
<span className="min-w-[1.25rem] text-xs font-medium">{commentCount}</span>
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue