import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { format } from "date-fns"; import ReactMarkdown from "react-markdown"; import { type Note } from "@/hooks/use-notes"; import { Edit, Calendar, Pin } from "lucide-react"; import { getNoteColor } from "@/lib/constants"; import clsx from "clsx"; import remarkGfm from "remark-gfm"; import { RelatedNotes } from "./related-notes"; interface NoteViewDialogProps { note: Note; open: boolean; onOpenChange: (open: boolean) => void; onEdit: () => void; onSelectNote?: (id: string) => void; } export function NoteViewDialog({ note, open, onOpenChange, onEdit, onSelectNote }: NoteViewDialogProps) { const colorClass = getNoteColor(note.color); return (
{note.title} {note.is_pinned && ( )}
Created {format(new Date(note.created_at), "MMMM d, yyyy 'at' h:mm a")}
{note.content}
{/* Smart Features: Related Notes */}
{ onOpenChange(false); setTimeout(() => onSelectNote(id), 100); // Small delay to allow dialog close animation? } : undefined} />
{note.tags.map(tag => ( {tag.name} ))}
); }