import React, { useMemo } from 'react'; import { motion } from 'motion/react'; import { Clock, Calendar, TrendingUp, Zap, History, ArrowRight, Sparkles, PieChart } from 'lucide-react'; import { Note, NoteAccessLog, NotePrediction } from '../types'; import { predictNextAccess, detectAccessCycle } from '../services/temporalService'; interface TemporalViewProps { notes: Note[]; accessLogs: NoteAccessLog[]; onNoteSelect: (id: string) => void; } export const TemporalView: React.FC = ({ notes, accessLogs, onNoteSelect }) => { const predictions = useMemo(() => { return notes .map(note => { const noteLogs = accessLogs.filter(l => l.noteId === note.id); const prediction = predictNextAccess(note, noteLogs); return { note, prediction }; }) .filter(p => p.prediction !== null) as { note: Note; prediction: NotePrediction }[]; }, [notes, accessLogs]); const cyclicalNotes = useMemo(() => { return notes .map(note => { const noteLogs = accessLogs.filter(l => l.noteId === note.id); const cycle = detectAccessCycle(noteLogs); return { note, cycle }; }) .filter(p => p.cycle !== null) as { note: Note; cycle: number }[]; }, [notes, accessLogs]); return (

Temporal Forecast

Predicting the recurrence of insight

{/* Daily Briefing / Predictions */}

Intelligence Briefing

{predictions.map(({ note, prediction }) => ( onNoteSelect(note.id)} className="p-6 rounded-2xl bg-white dark:bg-white/5 border border-border/60 hover:border-rose-400/40 transition-all cursor-pointer shadow-sm relative overflow-hidden group" >
Coming Up {new Date(prediction.predictedRelevanceDate).toLocaleDateString(undefined, { month: 'short', day: 'numeric' })}

{note.title}

"{prediction.reason}"

Confidence {Math.round(prediction.confidence * 100)}%
))} {predictions.length === 0 && (
No upcoming predictions

The system needs more usage data to find cyclical patterns in your research.

)}
{/* Cyclical Patterns */}

Detected Cycles

{cyclicalNotes.map(({ note, cycle }) => (
{Math.round(cycle)} days
{note.title}
Recurring theme in your architectural process
))}
{/* Productivity Stats */}
Memory Strength
84%

Active connections in your semantic network

Peak Cycle
28 Days

The rhythm of your creative output

4 Notes resurfacing this week
); };