import React from 'react'; import type { Note } from '../types'; type Props = { item: Note; isSelected: boolean; onSelect: () => void; index: number; }; export function NoteListItem({ item, isSelected, onSelect, index }: Props) { // Get preview text (first 100 characters) const previewText = item.text.substring(0, 100) + (item.text.length > 100 ? '...' : ''); return (
{ if (!isSelected) { e.currentTarget.style.backgroundColor = '#f9f7f4'; } }} onMouseLeave={(e) => { if (!isSelected) { e.currentTarget.style.backgroundColor = 'transparent'; } }} >
{previewText}
); }