import React, { useMemo, useState } from 'react'; import { IcNavBack, IcLock, IcMoreVert } from '../res/icons'; import { SIMULATOR_CONFIG } from '@/os/data'; const { statusBarHeight, bottomGestureHeight } = SIMULATOR_CONFIG.framework; import * as TimeService from '../../../os/TimeService'; import { useNotesStore, selectPrivateNotes } from '../state'; import { ActionSheet } from '../components/ActionSheet'; import { Toast } from '@/os/components/Toast'; import { colors } from '../res/colors'; import { strings } from '../res/strings'; import { stringsEn } from '../res/strings.en'; import { useAppStrings } from '../../../os/useAppStrings'; import type { Note } from '../types'; import { useNotesGestures } from '../hooks/useNotesGestures'; function formatListTime(timestamp: number, s: typeof strings) { const d = TimeService.fromTimestamp(timestamp); const y = d.getFullYear(); const m = d.getMonth() + 1; const day = d.getDate(); const now = TimeService.getDate(); if (y !== now.getFullYear()) return `${y}${s.date_suffix_year}${m}${s.date_suffix_month}${day}${s.date_suffix_day}`; const hh = d.getHours().toString().padStart(2, '0'); const mm = d.getMinutes().toString().padStart(2, '0'); return `${m}${s.date_suffix_month}${day}${s.date_suffix_day} ${hh}:${mm}`; } function snippet(text: string) { return (text || '').replace(/\s+/g, ' ').trim(); } const PrivateCard: React.FC<{ note: Note; onOpen: () => void; onActions: () => void; }> = ({ note, onOpen, onActions }) => { const s = useAppStrings(strings, stringsEn); const title = note.title.trim() || s.untitled; const content = snippet(note.content); return (