/* * ============================================================================= * VibeQuant (vquant) — AI-Powered Financial Intelligence Platform * ----------------------------------------------------------------------------- * File: client/src/components/chat/session-history.tsx * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * Website: https://www.spboucher.ai * Demo: https://www.vquant.ai * License: MIT (see LICENSE) * * Copyright © 2026 Simon-Pierre Boucher. All rights reserved. * ============================================================================= */ import { useQuery } from "@tanstack/react-query"; import { Button } from "@/components/ui/button"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Clock, MessageSquare } from "lucide-react"; import { formatDistanceToNow } from "date-fns"; interface SessionListItem { sessionId: string; title: string; createdAt: string; updatedAt: string; } interface SessionHistoryProps { onLoadSession: (sessionId: string) => void; currentSessionId: string | null; } export function SessionHistory({ onLoadSession, currentSessionId }: SessionHistoryProps) { const { data: sessions = [], isLoading } = useQuery({ queryKey: ['/api/sessions'], }); if (isLoading) { return (
Loading sessions...
); } if (sessions.length === 0) { return (

No conversation history yet

); } return (

History

{sessions.map((session) => ( ))}
); }