Files
Momento/memento-note/components/label-badge.tsx
Antigravity 1fcea6ed7d
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 7s
feat: brainstorm sessions, PDF document Q&A, embedding fixes, and UI improvements
- Add brainstorm feature with collaborative canvas, AI idea generation, live cursors, playback, and export
- Add PDF upload/extraction/ingestion pipeline with pgvector document search (RAG)
- Add document Q&A overlay with streaming chat and PDF preview
- Add note attachments UI with status polling, grid layout, and auto-scroll
- Add task extraction AI tool and agent executor improvements
- Fix NoteEmbedding missing updatedAt column, re-index 66 notes with 1536-dim embeddings
- Fix brainstorm 'Create Note' button: add success toast and redirect to created note
- Fix memory echo notification infinite polling
- Fix chat route to always include document_search tool
- Add brainstorm i18n keys across all 14 locales
- Add socket server for real-time brainstorm collaboration
- Add hierarchical notebook selector and organize notebook dialog improvements
- Add sidebar brainstorm section with session management
- Update prisma schema with brainstorm tables, attachments, and document chunks
2026-05-14 17:43:21 +00:00

76 lines
2.1 KiB
TypeScript

'use client'
import { cn } from '@/lib/utils'
import { X, Sparkles } from 'lucide-react'
interface LabelBadgeProps {
label: string
type?: 'ai' | 'user'
onRemove?: () => void
variant?: 'default' | 'filter' | 'clickable'
onClick?: () => void
isSelected?: boolean
isDisabled?: boolean
}
export function LabelBadge({
label,
type,
onRemove,
variant = 'default',
onClick,
isSelected = false,
isDisabled = false,
}: LabelBadgeProps) {
const isAI = type === 'ai'
return (
<button
type="button"
onClick={onClick}
disabled={isDisabled}
className={cn(
'inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[9px] font-bold uppercase tracking-wider transition-all',
variant === 'filter' && !isSelected && 'cursor-pointer',
variant === 'clickable' && 'cursor-pointer',
isDisabled && 'opacity-50 cursor-not-allowed',
isSelected
? 'bg-foreground text-background border-foreground shadow-sm'
: isAI
? 'bg-[#A47148]/10 border-[#A47148]/25 text-[#A47148]'
: 'bg-[#8D8D8D]/10 border-[#8D8D8D]/25 text-[#8D8D8D]',
)}
>
{isAI && (
<Sparkles size={8} className="text-[#A47148]/70" />
)}
<span className="truncate">{label}</span>
{onRemove && (
<span
role="button"
tabIndex={0}
onClick={(e) => {
e.stopPropagation()
onRemove()
}}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.stopPropagation()
onRemove()
}
}}
className="hover:text-red-500 transition-colors cursor-pointer"
>
<X size={8} />
</span>
)}
{isAI && !isSelected && (
<span className="relative flex h-1.5 w-1.5">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-[#A47148] opacity-75" />
<span className="relative inline-flex rounded-full h-1.5 w-1.5 bg-[#A47148]" />
</span>
)}
</button>
)
}