import React, { useState } from 'react'; import { Plus, Sparkles, MoreVertical, Trash2, Edit2, Check, LayoutGrid, Rocket, Github, Loader2, RefreshCcw, MessageSquarePlus } from 'lucide-react'; import { Note } from '../types'; interface NotesPanelProps { notes: Note[]; onAddNote: () => void; onUpdateNote: (note: Note) => void; onDeleteNote: (id: string) => void; onUseTemplate: (note: Note) => void; onGenerateSummary: (note: Note) => void; queue?: string[]; hfTimerQueue?: { templates: string[], nextExecutionTime: number }; onHuggingFaceCue?: () => void; onRefreshTemplates?: () => void; isRefreshing?: boolean; onOpenNewSession?: () => void; } export const NotesPanel: React.FC = ({ notes, onAddNote, onUpdateNote, onDeleteNote, onUseTemplate, onGenerateSummary, queue = [], hfTimerQueue, onHuggingFaceCue, onRefreshTemplates, isRefreshing, onOpenNewSession }) => { const [editingId, setEditingId] = useState(null); return (

Message Templates

{onRefreshTemplates && ( )} {onOpenNewSession && ( )}
{/* HuggingFace Cue Button */} {onHuggingFaceCue && ( )} {/* Queue Status */} {hfTimerQueue && hfTimerQueue.templates.length > 0 && (
Auto-Queue: {hfTimerQueue.templates.length} waiting (runs in {Math.max(0, Math.ceil((hfTimerQueue.nextExecutionTime - Date.now()) / 60000))} mins)
)} {queue.length > 0 && (
Cue: {queue.length} templates pending
)}
{/* Load Templates Button - Only show if no remote templates exist and handler is provided */} {onRefreshTemplates && !notes.some(n => n.id.startsWith('github-')) && (
{isRefreshing ? : }

No Remote Templates

Connect to GitHub to load your shared message templates.

)} {notes.map((note) => (
{editingId === note.id ? (
onUpdateNote({ ...note, title: e.target.value })} className="w-full font-bold text-gray-800 bg-transparent outline-none placeholder-gray-400" placeholder="Title" autoFocus />