import React, { useState, useRef, useEffect } from 'react'; // --- Types --- type Message = { id: string; sender: 'user' | 'other'; senderName?: string; text: string; time: string; isReply?: boolean; replyTo?: { name: string; text: string }; }; // --- Test Data (From your HTML) --- const TEST_MESSAGES: Message[] = [ { id: '1', sender: 'other', senderName: 'Timothy Araujo', text: 'Life is sweet if you want it to be.', time: '21:39', }, { id: '2', sender: 'other', senderName: 'Timothy Araujo', text: 'All this work will pay off, it’s certain.', time: '21:39', }, { id: '3', sender: 'other', senderName: 'Simon Atanushe', text: 'That’s the way, my guy.', time: '21:39', isReply: true, replyTo: { name: 'Timothy Araujo', text: 'All this work will pay off, it’s certain.' }, }, { id: '4', sender: 'user', text: 'Life is sweet if you want it to be.', time: '21:39', }, { id: '5', sender: 'user', text: 'All this work will pay off, it’s certain.', time: '21:39', }, { id: '6', sender: 'other', senderName: 'Timothy Araujo', text: 'God is not wicked. 😭😭', time: '21:39', }, { id: '7', sender: 'other', senderName: 'Simon Atanushe', text: "Let's cook mfs. I have a gig tonight to build a creative asset for a startup. Need to work on it overnight", time: '21:39', isReply: true, replyTo: { name: 'Timothy Araujo', text: 'All this work will pay off, it’s certain.' }, }, { id: '8', sender: 'other', senderName: 'Jeremiah Annuit', text: "It's shopify marketing I want to be doing. All this code is not my concern.", time: '21:39', isReply: true, replyTo: { name: 'Timothy Araujo', text: 'All this work will pay off, it’s certain.' }, }, ]; // --- Components --- const PinnedMessage = () => (
Me in the next 2 years
{msg.replyTo.name}
{msg.replyTo.text}
{msg.text}
{/* Timestamp */}