nexus/ui/src/components/ChatMessageBookmark.tsx
Nexus Dev ac6d75ab0d feat(24-02): UI components — ChatSearchDialog, ChatMessageBookmark, ChatBookmarkList, ChatBranchSelector
- ChatSearchDialog: CommandDialog with shouldFilter=false for server-side FTS, term highlighting via React components
- ChatMessageBookmark: ghost icon button with fill-current for bookmarked state, aria-label toggle
- ChatBookmarkList: scrollable list with skeleton loading, empty state, navigation callbacks
- ChatBranchSelector: horizontal branch picker bar with GitBranch icon, active branch highlight
2026-04-04 03:55:48 +00:00

35 lines
1,011 B
TypeScript

import { Bookmark } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
interface ChatMessageBookmarkProps {
messageId: string;
conversationId: string;
isBookmarked: boolean;
onToggle: () => void;
}
export function ChatMessageBookmark({ isBookmarked, onToggle }: ChatMessageBookmarkProps) {
return (
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="icon"
className="h-6 w-6"
onClick={onToggle}
aria-label={isBookmarked ? "Remove bookmark" : "Bookmark message"}
>
<Bookmark
className={cn(
"h-3.5 w-3.5",
isBookmarked && "fill-current",
)}
/>
</Button>
</TooltipTrigger>
<TooltipContent>{isBookmarked ? "Remove bookmark" : "Bookmark message"}</TooltipContent>
</Tooltip>
);
}