import React from 'react'; import { useNavigate } from 'react-router-dom'; import { Avatar, Button, Card, Divider, Space, Tag, Timeline, Typography, } from 'antd'; import { ArrowRightOutlined, CalendarOutlined, ClockCircleOutlined, DeleteOutlined, EditOutlined, TeamOutlined, UserOutlined, } from '@ant-design/icons'; import ActionButton from './ActionButton'; import tools from '../utils/tools'; import './MeetingInfoCard.css'; const { Text, Paragraph } = Typography; const ROLE_META = { creator: { label: '我发起', tagClass: 'console-tag-soft-blue', }, attendee: { label: '我参与', tagClass: 'console-tag-soft-green', }, }; const STATUS_META = { completed: { label: '已完成', tagClass: 'console-tag-soft-green', }, failed: { label: '失败', tagClass: 'console-tag-soft-red', }, transcribing: { label: '转写中', tagClass: 'console-tag-soft-blue', }, summarizing: { label: '总结中', tagClass: 'console-tag-soft-orange', }, pending: { label: '待处理', tagClass: 'console-tag-soft-default', }, }; const formatDateMeta = (date) => { const parsed = new Date(date); if (Number.isNaN(parsed.getTime())) { return { main: date, sub: '' }; } return { main: tools.formatDateLong(date), sub: parsed.toLocaleDateString('zh-CN', { weekday: 'long' }), }; }; const getStatusMeta = (meeting) => STATUS_META[meeting?.overall_status || 'pending'] || STATUS_META.pending; const getSummaryPreview = (summary) => { if (!summary) return ''; return tools.stripMarkdown(summary).replace(/\s+/g, ' ').trim(); }; const MeetingTimeline = ({ meetingsByDate, currentUser, onDeleteMeeting, hasMore = false, onLoadMore, loadingMore = false, filterType = 'all', searchQuery = '', selectedTags = [], }) => { const navigate = useNavigate(); const handleEditClick = (event, meetingId) => { event.preventDefault(); event.stopPropagation(); navigate(`/meetings/edit/${meetingId}`); }; const handleDeleteClick = (event, meeting) => { event.preventDefault(); event.stopPropagation(); onDeleteMeeting(meeting.meeting_id); }; const sortedDates = Object.keys(meetingsByDate).sort((a, b) => new Date(b) - new Date(a)); const timelineItems = sortedDates.map((date) => { const dateMeta = formatDateMeta(date); return { label: (