'use client' import { type ReactNode } from 'react' import { motion, AnimatePresence, useReducedMotion } from 'motion/react' import { X, Maximize2, Loader2 } from 'lucide-react' import { useLanguage } from '@/lib/i18n' import type { Note } from '@/lib/types' import { NotePeekContent } from './note-peek-content' interface NotePeekPanelProps { note: Note | null blockId?: string loading?: boolean mode: 'overlay' | 'inline' onClose: () => void onOpenFully?: (note: Note) => void labelKey?: string renderContent?: (note: Note, blockId?: string) => ReactNode } export function NotePeekPanel({ note, blockId, loading = false, mode, onClose, onOpenFully, labelKey = 'notePeek.label', renderContent, }: NotePeekPanelProps) { const { t, language } = useLanguage() const isRtl = language === 'fa' || language === 'ar' const prefersReducedMotion = useReducedMotion() const isOpen = note !== null || loading const spring = prefersReducedMotion ? { duration: 0 } : { type: 'spring' as const, stiffness: 340, damping: 34 } const content = ( <>