"use client"; import { useState } from "react"; import { Pencil, Trash2, Check, X } from "lucide-react"; interface Props { content: string; onPatch: (newContent: string) => void; onDelete: () => void; } export function MemoryEntry({ content, onPatch, onDelete }: Props) { const [editing, setEditing] = useState(false); const [editText, setEditText] = useState(content); const [confirmDelete, setConfirmDelete] = useState(false); const handleSave = () => { if (editText.trim() && editText !== content) { onPatch(editText.trim()); } setEditing(false); }; if (editing) { return (
{content}