import React from 'react'; import { InspirationItem } from '../types'; interface InspirationCardProps { item: InspirationItem; index: number; } export const InspirationCard: React.FC = ({ item, index }) => { // Format time (e.g., "10:42 AM" or "Jan 17 · Evening") const formatTime = (timestamp: number) => { const date = new Date(timestamp); const now = new Date(); const isToday = date.toDateString() === now.toDateString(); if (isToday) { return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); } else { const monthDay = date.toLocaleDateString([], { month: 'short', day: 'numeric' }); // Simple logic to approximate time of day for "companion" feel const hour = date.getHours(); let timeOfDay = 'Day'; if (hour < 12) timeOfDay = 'Morning'; else if (hour < 18) timeOfDay = 'Afternoon'; else timeOfDay = 'Evening'; return `${monthDay} · ${timeOfDay}`; } }; return (
{/* Inner Highlight */}
{/* Content */}

{item.content}

{/* Footer: Tags + Time */}
{/* Tags */}
{item.tags?.map((tag, i) => ( #{tag} ))}
{/* Timestamp */} {formatTime(item.createdAt)}
); };