"use client" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Badge } from "@/components/ui/badge" import { useMaterial } from "@/contexts/material-context" import { cn } from "@/lib/utils" import { Search, Settings, Edit, Phone, Video, Info, Smile, Paperclip, Send, MoreVertical, ChevronDown, ImageIcon, File, Mic, } from "lucide-react" import { useState } from "react" export function MessagingAppExample() { const { selectedMaterial, getThemeAwareClass } = useMaterial() const materialClass = selectedMaterial ? getThemeAwareClass(selectedMaterial) : "" const [message, setMessage] = useState("") const contacts = [ { name: "Sarah Johnson", status: "online", lastMessage: "Sure, let's meet at 3pm tomorrow", time: "10:42 AM", unread: 0, avatar: "/diverse-person-portrait.png", }, { name: "Design Team", status: "online", lastMessage: "Alex: I've updated the mockups", time: "9:30 AM", unread: 3, avatar: "/diverse-group-conversation.png", isGroup: true, }, { name: "Michael Chen", status: "offline", lastMessage: "Thanks for the feedback!", time: "Yesterday", unread: 0, avatar: "/diverse-avatars.png", }, { name: "Emma Wilson", status: "online", lastMessage: "Can you send me the files?", time: "Yesterday", unread: 0, avatar: "/diverse-group-meeting.png", }, ] const messages = [ { id: 1, sender: "Sarah Johnson", content: "Hi there! How's the project coming along?", time: "10:30 AM", isMe: false, }, { id: 2, sender: "Me", content: "Hey Sarah! It's going well. I've finished the initial designs and I'm working on the prototypes now.", time: "10:32 AM", isMe: true, }, { id: 3, sender: "Sarah Johnson", content: "That sounds great! When do you think you'll be able to share them with the team?", time: "10:35 AM", isMe: false, }, { id: 4, sender: "Me", content: "I'm planning to have everything ready by tomorrow afternoon. Would 3pm work for a review meeting?", time: "10:38 AM", isMe: true, }, { id: 5, sender: "Sarah Johnson", content: "Sure, let's meet at 3pm tomorrow. I'll send out a calendar invite to the team.", time: "10:42 AM", isMe: false, }, ] return (
{/* Sidebar - Contacts */}

Messages

{contacts.map((contact, i) => ( ))}
{/* Main Chat Area */}
{/* Chat Header */}
SJ

Sarah Johnson

• Online

Last active 2m ago

{/* Messages */}
{messages.map((msg) => (
{!msg.isMe && ( SJ )}

{msg.content}

{msg.time}

))}
{/* Message Input */}
setMessage(e.target.value)} />
) }